Click here to Skip to main content
15,881,248 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: String Problem Pin
Maximilien14-Jan-11 1:59
Maximilien14-Jan-11 1:59 
Questioncreate dimmed icon with magick++ (ImageMagick) Pin
Thue Andersen13-Jan-11 22:10
Thue Andersen13-Jan-11 22:10 
AnswerRe: create dimmed icon with magick++ (ImageMagick) Pin
Chris Losinger14-Jan-11 3:04
professionalChris Losinger14-Jan-11 3:04 
AnswerRe: create dimmed icon with magick++ (ImageMagick) [modified] Pin
User 742933814-Jan-11 11:33
professionalUser 742933814-Jan-11 11:33 
GeneralRe: create dimmed icon with magick++ (ImageMagick) Pin
Thue Andersen16-Jan-11 5:00
Thue Andersen16-Jan-11 5:00 
GeneralRe: create dimmed icon with magick++ (ImageMagick) Pin
Rozis18-Jan-11 8:08
Rozis18-Jan-11 8:08 
GeneralRe: create dimmed icon with magick++ (ImageMagick) Pin
Thue Andersen18-Jan-11 22:13
Thue Andersen18-Jan-11 22:13 
QuestionIsalpha Function Issue. Pin
Mike Certini13-Jan-11 18:00
Mike Certini13-Jan-11 18:00 
In the below code, I am attempting to count the number of letters and number of words in a phrase. In researching the return values of isalpha(), I noted that when a letter is present the first character isalpha() output is 1. But the second character isalpha() output is 2? The phrase that was input into this example was the following: How do you organize? Can someone help me with why I am not getting uniform output for the "H" character and the "o" character?

#include <stdio.h>
#include <ctype.h>

int main(void)
	{
	int ch;
	float avg = 0;
	int spaces = 0;
	int letters = 0;
	int test = 0;
	int ltrcnt = 0;
	int spccnt = 0;		
	while((ch = getchar()) != '\n')
		{
		test = isalpha(ch);
		if(isalpha(ch) == 2)
			{
			ltrcnt++;
			}
		if(isspace(ch) == 8)
			{
			spccnt++;
			}
		}
	printf("The Number Of Words Are %d , The Number Of Letters Are %d ",(spccnt+1),ltrcnt);
	
	}

AnswerRe: Isalpha Function Issue. Pin
Cool_Dev13-Jan-11 18:11
Cool_Dev13-Jan-11 18:11 
GeneralRe: Isalpha Function Issue. Pin
Andrew Brock13-Jan-11 18:15
Andrew Brock13-Jan-11 18:15 
GeneralRe: Isalpha Function Issue. Pin
Mike Certini13-Jan-11 18:28
Mike Certini13-Jan-11 18:28 
AnswerRe: Isalpha Function Issue. Pin
Luc Pattyn14-Jan-11 0:56
sitebuilderLuc Pattyn14-Jan-11 0:56 
GeneralRe: Isalpha Function Issue. Pin
Mike Certini13-Jan-11 18:28
Mike Certini13-Jan-11 18:28 
AnswerRe: Isalpha Function Issue. Pin
Richard MacCutchan13-Jan-11 22:00
mveRichard MacCutchan13-Jan-11 22:00 
Questionwcstok [modified] Pin
csrss13-Jan-11 2:40
csrss13-Jan-11 2:40 
AnswerRe: wcstok Pin
Cedric Moonen13-Jan-11 2:53
Cedric Moonen13-Jan-11 2:53 
GeneralRe: wcstok Pin
csrss13-Jan-11 3:20
csrss13-Jan-11 3:20 
GeneralRe: wcstok Pin
Luc Pattyn13-Jan-11 3:26
sitebuilderLuc Pattyn13-Jan-11 3:26 
GeneralRe: wcstok Pin
csrss13-Jan-11 3:29
csrss13-Jan-11 3:29 
GeneralRe: wcstok Pin
Luc Pattyn13-Jan-11 3:40
sitebuilderLuc Pattyn13-Jan-11 3:40 
GeneralRe: wcstok Pin
csrss13-Jan-11 4:04
csrss13-Jan-11 4:04 
QuestionRe: wcstok Pin
Luc Pattyn13-Jan-11 4:14
sitebuilderLuc Pattyn13-Jan-11 4:14 
AnswerRe: wcstok Pin
csrss13-Jan-11 4:24
csrss13-Jan-11 4:24 
AnswerRe: wcstok Pin
Luc Pattyn13-Jan-11 6:51
sitebuilderLuc Pattyn13-Jan-11 6:51 
GeneralRe: wcstok Pin
Cedric Moonen13-Jan-11 3:44
Cedric Moonen13-Jan-11 3:44 

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.