-
Remove comments
hi all
Code:
#include<stdio.h>
#include<stdlib.h>
#define BUF 250
main()
{
FILE *fp;
char buffer[BUF];
int count;
char *loc;
if((fp=fopen("New Text Document.txt","r"))==NULL)
{
printf("Error");
exit(0);
}
while((fgets(buffer,BUF,fp))!=NULL)
{
if(loc=strstr(buffer,"/*"))
{
buffer[loc-buffer]='\0';
}
printf("%s\n",buffer);
}
fclose(fp);
}
:) your advices pleas :);
thanks
-
about fopen("New Text Document.txt","r"))
never mind about it :) i am to lazy to take user input at now
-
Fix indentation?
No wait, we've done that sketch already...
-
heeeeeeeeeeeheeeeeeeeeeeeeeeheeeeeeeeeeeeeee
i am in a way over my head in indentation i hate dev cpp compiler
but tell me is the code is o.k !
-
you should test the code by yourself before asking if it is ok
Code:
int main(/* no args*/)
{
/*
* Now the important part - variable iniitialization
*/
int i = /* let's initialize it with something*/ 0;
}
give it as input and see what is the output...