Page Number: Página 1 de 1
Actual Results
- fish
- Foro: Programming / Scripting / Coding Forum
- Tema: separating a sentence into words
- Subject: separating a sentence into words
- Respuestas: 17
- Vistas: 12646
- Subject: separating a sentence into words
Posted: Abril 4th, 2003, 7:51 pm
this is what i have so far but i cant work out how to put each word into a new array [code] int reverseWords() { char whole_line[MAX_LINE]; char word[MAX_LINE]; int i; printf("%s", "\nEnter a line of text (upto 50 characters): \n")...
- fish
- Foro: Programming / Scripting / Coding Forum
- Tema: separating a sentence into words
- Subject: separating a sentence into words
- Respuestas: 17
- Vistas: 12646
- Subject: separating a sentence into words
Posted: Abril 4th, 2003, 6:22 pm
thanks for the help.
Could you please give me some idea how to code what you put in your post, as stated in an earlier thread I am a true 'NOVICE'.
thanks
Could you please give me some idea how to code what you put in your post, as stated in an earlier thread I am a true 'NOVICE'.
thanks
- fish
- Foro: Programming / Scripting / Coding Forum
- Tema: separating a sentence into words
- Subject: separating a sentence into words
- Respuestas: 17
- Vistas: 12646
- Subject: separating a sentence into words
Posted: Abril 4th, 2003, 4:16 pm
Hi there, I was after any suggestions as to how i could -- accept a sentence from the user -- then take each word from that sentence and display it in reverse order, but not reverse the order of the the whole sentence. I was thinking to loop until '\0' - end of line then within that loop, loop until...
- fish
- Foro: Programming / Scripting / Coding Forum
- Tema: array and loop question from an absolute beginner!!!
- Subject: array and loop question from an absolute beginner!!!
- Respuestas: 7
- Vistas: 2304
Posted: Marzo 31st, 2003, 4:12 am
I think i finally worked it out, i used fgets() then a
for(i = 0; i < MAX_LINE, ch[i] !='\0'; i++)
it has stopped my problem of accepting characters after <return> was entered if the 50 spaces in the array weren't filled.
thanks so much for your help.
for(i = 0; i < MAX_LINE, ch[i] !='\0'; i++)
it has stopped my problem of accepting characters after <return> was entered if the 50 spaces in the array weren't filled.
thanks so much for your help.
- fish
- Foro: Programming / Scripting / Coding Forum
- Tema: array and loop question from an absolute beginner!!!
- Subject: array and loop question from an absolute beginner!!!
- Respuestas: 7
- Vistas: 2304
Posted: Marzo 29th, 2003, 6:15 am
Hi there, could someone help me please, Ive just stared with c and I want the function to accept upto 50 characters but finish when i hit return and then to change the case of them. It continues to accept characters after i have hit return up until the array of 50 is finished. My next problem is tha...
