Help please.. I need some help in C to open a file and search for a string. If the string is found then move one space and copy the next string to end-of-line back to buffer. I am creating a program using pthreads and need to search this file in a thread. Just a simple code if possible would help. Thanks.
jeffhorton1965
5
Newbie Poster
Recommended Answers
Jump to Postthese functions will be your friends:
fopen()
strstr()
strcpy()
fclose()
Jump to Postno problem. if you get stuck, come back and post your code. :)
Jump to PostWhat two things are wrong with this line
scanf("%d", &abc[30]);
???hint for 1: you have defined abc as a character array, didn't you?
You need to study the
printf()
function closer...
All 12 Replies
jephthah
1,888
Posting Maven
jeffhorton1965
5
Newbie Poster
jephthah
1,888
Posting Maven
jeffhorton1965
5
Newbie Poster
jeffhorton1965
5
Newbie Poster
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
jeffhorton1965
5
Newbie Poster
jeffhorton1965
5
Newbie Poster
WaltP
commented:
Was there a need to quote your other post?
-2
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
jeffhorton1965
5
Newbie Poster
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
jeffhorton1965
5
Newbie Poster
jephthah
commented:
you're welcome
+7
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.