Difference between revisions of "Bmpinfo.c"

From AdonaiMedrado.Pro.Br
Jump to: navigation, search
(New page: <code lang="c"> #include <stdio.h> int main(int argc, char *argv[]) { FILE *fp; int w=0,h=0; fp = fopen(argv[1],"r"); fseek(fp,0x12,SEEK_SET); fread(&w,sizeof(int),1,fp); fread(&h,s...)
 
 
Line 5: Line 5:
 
{
 
{
 
FILE *fp;
 
FILE *fp;
int w=0,h=0;
+
int w,h;
 
fp = fopen(argv[1],"r");
 
fp = fopen(argv[1],"r");
 
fseek(fp,0x12,SEEK_SET);
 
fseek(fp,0x12,SEEK_SET);

Latest revision as of 16:25, 12 June 2009

#include <stdio.h>
 
int main(int argc, char *argv[])
{
	FILE *fp;
	int w,h;
	fp = fopen(argv[1],"r");
	fseek(fp,0x12,SEEK_SET);
	fread(&w,sizeof(int),1,fp);
	fread(&h,sizeof(int),1,fp);
	printf("Largura: %d x Altura: %d\n",w,h);
	fclose(fp);
	return 0;
}