is there any function to add a character at the end of a string? or algorithm?
Thundermax
0
Light Poster
Recommended Answers
Jump to PostCurious: why didn't you use standard C string function strcpy() instead of your chop()?
lines 70 and 71: increase the size of those two because they probably aren't big enough.
Jump to PostDo you use Notepad to view the file? Dev-C++ is a pretty old and obsolete IDE/compiler. you might want to install Code::Blocks with MinGW compiler from here, it's free and current.
Jump to PostNow run this:
while(fgets(string, sizeof(string), p) != NULL ) { printf("%s", string); choppy(string); printf("%s\n", string); cop(string, a2); printf("%s\n", string); strcat(a2, nameyes); cop(string, a3); printf("%s\n\n", string); strcat(a3, nameno); func(string, namesearch, nameend, a2, a3); }
Jump to PostDoes the input text file have a cr after the last line? If not, put one there and retest. If not then the proglem has to be choppy() -- the last line may not have '\n' at the end of the line.
void choppy( char *s ) …
Jump to Postit took the space " " that exists in the last row
Huh? The function does nothing if there is no '\n' in the string. If you want a space there then modify the function to append a space if there is no '\n'.
All 37 Replies
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
Thundermax
0
Light Poster
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
Thundermax
0
Light Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Thundermax
0
Light Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Thundermax
0
Light Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Thundermax
0
Light Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Thundermax
0
Light Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Thundermax
0
Light Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Thundermax
0
Light Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Thundermax
0
Light Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Thundermax
0
Light Poster
Thundermax
0
Light Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Thundermax
0
Light Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Thundermax
0
Light Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Thundermax
0
Light Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
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.