| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Linked list
Hi,
I have two problems: please can someone give me an algorithm that would help me to understand how to put words ( read from a file) in alphabetical order using a linked list. I just dont get it!! Also, The words that I need to input is a real text. but There is punctuation (",", "!",".") that I need to skip in order to continue inputting words. I know that I can do Code:
fscanf(fptr," [^,], ", words) to skip the comma. but how can I do all the 3 punctuations in once? Thank you for your help and time B. |
|
#2
|
|||
|
|||
|
you can input the whole file (or each line) into a buffer, and then use strtok (http://www.cplusplus.com/ref/cstring/strtok.html) to step through it, splitting on punctuation (you can specify multiple delimiters)
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > Linked list |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|