Click here to Skip to main content
15,900,378 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: Upgrade to Visual Studio .Net 2003 Pin
Albert Ho [msft]6-May-03 23:20
Albert Ho [msft]6-May-03 23:20 
GeneralStarting an .exe from an MC++ app Pin
ChrisA30-Apr-03 18:58
ChrisA30-Apr-03 18:58 
GeneralRe: Starting an .exe from an MC++ app Pin
jhaga1-May-03 6:13
professionaljhaga1-May-03 6:13 
GeneralRe: Starting an .exe from an MC++ app Pin
ChrisA1-May-03 10:55
ChrisA1-May-03 10:55 
GeneralRe: Starting an .exe from an MC++ app Pin
jhaga1-May-03 11:03
professionaljhaga1-May-03 11:03 
GeneralRe: Starting an .exe from an MC++ app Pin
ManagedCode5-May-03 18:07
ManagedCode5-May-03 18:07 
GeneralRe: Starting an .exe from an MC++ app Pin
ManagedCode5-May-03 18:11
ManagedCode5-May-03 18:11 
GeneralBeginner C++, text (array) sorting Pin
Sheshi29-Apr-03 23:29
Sheshi29-Apr-03 23:29 
Hi All, wondering if someone could take a look at the below function and give me any clues as to why the output shows nothing.

I've passed through a sentence (no more than 100 characters) called sentence, which was input by the user. I'm trying to take each word, alphabetize it, and display the number of characters for each.

Thanks for any help! Cool | :cool:

<br />
void countOfChars(char sentence[]) <br />
{<br />
	char *words = strtok(sentence," ");<br />
	char *alphaArray[maxWords], *swap;<br />
	int wordCount=0;<br />
<br />
	cout << "\n\nWORD\t\t" << "Characters" << endl;<br />
	<br />
	//count the number of words in the sentence to set up array size<br />
	while (words!=NULL) {<br />
		wordCount++;<br />
		words = strtok(NULL, " ");<br />
		}<br />
		alphaArray[wordCount] = words; //set up new array<br />
		for (int i=0; i<wordCount-1; i++) {<br />
			for (int j=0; j<wordCount-1; j++) {<br />
				if (alphaArray[i] > alphaArray[i+1])<br />
					swap = alphaArray[i+1];  //alphabetize array<br />
					alphaArray[i+1]=alphaArray[i];<br />
					alphaArray[i]=swap;<br />
	}}<br />
	for (int x=0; x<wordCount; x++) {	<br />
		cout << alphaArray[x] << "\t\t" << strlen(alphaArray[x]) << endl;<br />
		words = strtok(NULL, " ");<br />
	}<br />
	cout << endl;<br />
}<br />


Sheshi
GeneralRe: Beginner C++, text (array) sorting Pin
jhaga30-Apr-03 4:40
professionaljhaga30-Apr-03 4:40 
GeneralSimple question Pin
V.P.29-Apr-03 0:59
V.P.29-Apr-03 0:59 
GeneralRe: Simple question Pin
leppie29-Apr-03 7:53
leppie29-Apr-03 7:53 
GeneralRe: Simple question Pin
John R. Shaw29-Apr-03 18:28
John R. Shaw29-Apr-03 18:28 
GeneralPlease URGENT!! Pin
mAxW23-Apr-03 6:54
mAxW23-Apr-03 6:54 
GeneralRe: Please URGENT!! Pin
Paul Selormey23-Apr-03 18:21
Paul Selormey23-Apr-03 18:21 
GeneralControl toolbox icons Pin
Paul Selormey23-Apr-03 3:23
Paul Selormey23-Apr-03 3:23 
GeneralRe: Control toolbox icons Pin
leppie23-Apr-03 7:12
leppie23-Apr-03 7:12 
GeneralRe: Control toolbox icons Pin
Paul Selormey23-Apr-03 18:10
Paul Selormey23-Apr-03 18:10 
GeneralRe: Control toolbox icons Pin
leppie25-Apr-03 11:01
leppie25-Apr-03 11:01 
GeneralHiding unmanaged functions in assembly Pin
leppie21-Apr-03 8:42
leppie21-Apr-03 8:42 
GeneralRe: Hiding unmanaged functions in assembly Pin
Paul Selormey21-Apr-03 19:40
Paul Selormey21-Apr-03 19:40 
GeneralRe: Hiding unmanaged functions in assembly Pin
leppie22-Apr-03 7:06
leppie22-Apr-03 7:06 
GeneralRe: Hiding unmanaged functions in assembly Pin
leppie26-Apr-03 10:52
leppie26-Apr-03 10:52 
GeneralC and C++ compilers Pin
Mario_Young20-Apr-03 17:55
Mario_Young20-Apr-03 17:55 
GeneralRe: C and C++ compilers Pin
John R. Shaw29-Apr-03 18:57
John R. Shaw29-Apr-03 18:57 
GeneralRe: C and C++ compilers Pin
jhaga8-May-03 23:02
professionaljhaga8-May-03 23:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.