|
||||||
| C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
I'm writing a program that analyzes a given text file counting occurrences of each unique word. I've got it working except some nagging weird characters in a text file I downloaded to test my program with. I've got the following function that determines of an "end-of-word" character has been found :
Code:
/* Checks character and determines if it is a word-ending character */
int isWordEnding (char inChar) {
char endingChars[] = ",.!?()\":; \t[]{}_/\\\n*><#";
int x, y;
y = 0;
for (x = 0; x < 23; x++) {
if (inChar == endingChars[x]) {
y = 1;
break;
}
}
return y;
}
PRINCESS OF FRANCE. We arrest your word. Boyet, you can produce acquittances For such a sum from special officers Of Charles his father. KING. Satisfy me so. I've physically typed the same characters again and the program parses the words without any glitch. I've pasted the above text into MS Word and it just reads a new line and 4 spaces. Are there some other weird characters I don't know about? |
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Storing characters in an array | John | C and C++ | 3 | 03-04-2008 12:06 AM |
| read characters from buffered reader | random guy | Java Help | 2 | 12-02-2007 03:26 PM |
| Strange but i need it. | mandriva | Website Design | 4 | 11-10-2007 11:29 AM |
| Strange DLL Error, creating controls | ChrisPepper1989 | C and C++ | 0 | 02-26-2007 04:37 PM |
| Arabic Characters | Frantic | PHP Forum | 0 | 11-07-2006 07:42 PM |
| Xav | ........ | 1357.94 |
| MeTh0Dz|Reb0rn | ........ | 1087.45 |
| WingedPanther | ........ | 919.18 |
| morefood2001 | ........ | 909.18 |
| marwex89 | ........ | 906.86 |
| John | ........ | 902.37 |
| Brandon W | ........ | 789.89 |
| chili5 | ........ | 312.39 |
| Steve.L | ........ | 264.99 |
| dcs | ........ | 240.34 |
Goal: 100,000 Posts
Complete: 83%