S
SunRise
Hi
I am creating a C Program [ Turbo-C ] , to extract
only-Printable-characters from a file ( any type of file) and display
them.
OS: Windows-XP
Ple help me to fix the Errors & Warnings and explain how to use
Command-Line Arguments inside C program.
thanks
SunRise
--------------------------------------------------------
Warnings & Errors:
WARNING : Non-portable pointer compariosn in function main
Error(1) : Illegal structure operation in function main
Error(2) : Illegal structure operation in function main
Error(3) : Illegal structure operation in function main
Error(4) : type mismatch in parameter 'c' in call to "_fputc" in
function main*/
--------------------------------------------------------
#include <stdio.h>
#include <ctype.h>
#include <process.h>
void main()
{
/*char *file1 = argv[1]; */
FILE *fp1;
fp1=fopen("c:\\tmp\\tmp\\CPUCount20.exe","r");
if ( fp1 == NULL ) /* WARNING is here */
{
/* printf("Error opening file : %s\n\n", file1); */
printf("Exiting ...\n");
exit(1) ;
}
while( fp1 != EOF )
{
if( isprint(*fp1) ) /* Error(1) & Error(2) */
{
putc(*fp1,stdout); /* Error(3) & Error(4) */
}
fp1++;
}
printf(" ======= End of strings1 ======== \n\n");
}
I am creating a C Program [ Turbo-C ] , to extract
only-Printable-characters from a file ( any type of file) and display
them.
OS: Windows-XP
Ple help me to fix the Errors & Warnings and explain how to use
Command-Line Arguments inside C program.
thanks
SunRise
--------------------------------------------------------
Warnings & Errors:
WARNING : Non-portable pointer compariosn in function main
Error(1) : Illegal structure operation in function main
Error(2) : Illegal structure operation in function main
Error(3) : Illegal structure operation in function main
Error(4) : type mismatch in parameter 'c' in call to "_fputc" in
function main*/
--------------------------------------------------------
#include <stdio.h>
#include <ctype.h>
#include <process.h>
void main()
{
/*char *file1 = argv[1]; */
FILE *fp1;
fp1=fopen("c:\\tmp\\tmp\\CPUCount20.exe","r");
if ( fp1 == NULL ) /* WARNING is here */
{
/* printf("Error opening file : %s\n\n", file1); */
printf("Exiting ...\n");
exit(1) ;
}
while( fp1 != EOF )
{
if( isprint(*fp1) ) /* Error(1) & Error(2) */
{
putc(*fp1,stdout); /* Error(3) & Error(4) */
}
fp1++;
}
printf(" ======= End of strings1 ======== \n\n");
}