i have to write a code for compression of lines with redundancies. You are supposed to enter a line of code--for example(YES I CAN! YES I CAN! YES I CAN!) and your output should look like this (3YES3I3CAN3!) so the codes job is to count the number of times a word or character appears. i really appreciate the help. thank you very much
lazyboy292
0
Newbie Poster
Recommended Answers
Jump to PostOK, so what is your question?
Maybe start with reading a line and breaking it into words.
Jump to PostWell how do you read a line?
Consider writing a loop which looks for space characters.
Jump to PostYes, something like that.
If 'word' is say
char word[20]
, then words might bechar words[10][20]
All 11 Replies
Salem
5,138
Posting Sage
lazyboy292
0
Newbie Poster
Salem
5,138
Posting Sage
lazyboy292
0
Newbie Poster
Salem
5,138
Posting Sage
lazyboy292
0
Newbie Poster
John A
1,896
Vampirical Lurker
Team Colleague
twomers
408
Posting Virtuoso
lazyboy292
0
Newbie Poster
lazyboy292
0
Newbie Poster
John A
1,896
Vampirical Lurker
Team Colleague
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.