answersLogoWhite

0

What conversion do you mean? For example strtol is defined in stdlib.h, sprintf is defined in stdio.h.

User Avatar

Wiki User

14y ago

What else can I help you with?

Continue Learning about Engineering

Which header file should be included to use functions like malloc and calloc?

stdlib.h Next time try the built-in help/manual before asking.


Where should the Doctype be placed on the webpage?

A doctype is a header, so it should be placed at the top of the webpage. When writing HTML for a website, it should be placed directly above the tag.


What can you do when error occurs header file could not open?

You should find out the reason of the problem.Example:bad: #include good: #include


How do you create a header file and implementation of code in another c file and both should be retrieved by another .c file?

tanga


How do you write a header for a 128x128x128 dds volume texture file with no mipmaps and does it have to be written in binary?

According to the documentation on MSDN, the following code should create an uncompressed volume texture DDS file that's 32x32x32 in size. Re-scale as you see fit. Note: a 128x128x128 RGBA texture will take up 8 MB of VRAM! #include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #define DDSD_CAPS 0x00000001 #define DDSD_HEIGHT 0x00000002 #define DDSD_WIDTH 0x00000004 #define DDSD_PITCH 0x00000008 #define DDSD_PIXELFORMAT 0x00001000 #define DDSD_MIPMAPCOUNT 0x00020000 #define DDSD_LINEARSIZE 0x00080000 #define DDSD_DEPTH 0x00800000 #define DDPF_ALPHAPIXELS 0x00000001 #define DDPF_FOURCC 0x00000004 #define DDPF_RGB 0x00000040 #define DDSCAPS_COMPLEX 0x00000008 #define DDSCAPS_TEXTURE 0x00001000 #define DDSCAPS_MIPMAP 0x00400000 #define DDSCAPS2_CUBEMAP 0x00000200 #define DDSCAPS2_CUBEMAP_POSITIVEX 0x00000400 #define DDSCAPS2_CUBEMAP_NEGATIVEX 0x00000800 #define DDSCAPS2_CUBEMAP_POSITIVEY 0x00001000 #define DDSCAPS2_CUBEMAP_NEGATIVEY 0x00002000 #define DDSCAPS2_CUBEMAP_POSITIVEZ 0x00004000 #define DDSCAPS2_CUBEMAP_NEGATIVEZ 0x00008000 #define DDSCAPS2_VOLUME 0x00200000 int depth = 32; int width = 32; int height = 32; unsigned int header[32]; int main( int argc, char * argv[] ) { if( !argv[1] !strstr( argv[1], ".dds" ) ) { fprintf( stderr, "Usage: noise output.dds\n" ); return 1; } unsigned int cnt = width*height*depth*4; unsigned char * buf = new unsigned char[ cnt ]; while( cnt-- ) { buf[cnt] = rand()>>7; } memset( header, 0, sizeof( header ) ); header[0] = ' SDD'; header[1] = 124; header[2] = DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_DEPTH | DDSD_PITCH; header[3] = height; header[4] = width; header[5] = width*4; header[6] = depth; header[19] = 32; header[20] = DDPF_RGB|DDPF_ALPHAPIXELS; header[22] = 8; header[23] = 0xff0000; header[24] = 0xff00; header[25] = 0xff; header[26] = 0xff000000; header[27] = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX; header[28] = DDSCAPS2_VOLUME; FILE * f = fopen( argv[1], "wb" ); if( !f ) { fprintf( stderr, "can't create: %s\n", argv[1] ); return 1; } fwrite( header, 4, 32, f ); fwrite( buf, 1, width*height*depth, f ); fclose( f ); fprintf( stderr, "wrote %s\n", argv[1] ); return 0; }

Related Questions

Which header file should be included to enable string conversion?

What conversion do you mean? For example strtol is defined in stdlib.h, sprintf is defined in stdio.h.


What header file should include to enable string conversion in c?

What conversion do you mean? For example strtol is defined in stdlib.h, sprintf is defined in stdio.h.


When working with conversion problem why should units be included?

You need to know which units you are converting from and to.


What header file should be included if you are to develop a function that can accept variable number of arguments?

stdarg.h Before my original answer was removed and replaced with the above I suggested. Read the manual for your compiler the header files for each compiler are different. None of the compilers I currently use have a header file called "stdarg.h" but do have "varargs.h"


Which header file should be included to use functions like malloc and calloc?

stdlib.h Next time try the built-in help/manual before asking.


Should your header and footer be the same?

No they should not.


What should be included in an APA paper example title page?

An APA paper title page should include the title of the paper, the author's name, the institutional affiliation, and the author note. It should also have a running head and page number in the header.


On compilation a program throws an error saying a 'function should have prototype' what is wrong with the program?

One or more functions don't have a prototype. These functions should be either: - made static - have a prototype somewhere in a header (which is included into the same file)


Should high temp RTV be used on header gaskets?

No, header gaskets don't need any sealers on them.


What should be header file for printf?

#include <stdio.h>


What should be the header file for printf?

# include <stdio.h>


What are the torque specs for Ford Focus zetec header bolts?

The Ford focus header bolt torque specification is 90 pounds. The header bolts should be torqued in 45 pound intervals.