segmentation fault please help

Joined
Feb 4, 2010
Messages
1
Reaction score
0
I dont know whats wrong with my code so ig anyone could please help me i keep getting segmetation fault

#include<stdio.h>

int main(){
char s[100];
FILE*f=fopen("rec1.txt","r");
if(f==NULL)printf("greska");
FILE*g=fopen("reci2.txt","w");
if(g==NULL)printf("greska");

while(fscanf(f,"%s",s)!=EOF){
fprintf(g,"%s",s);}

fclose(f);
fclose(g);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top