Click here to Skip to main content
15,899,825 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: c++ Pin
Victor Nijegorodov7-Apr-23 6:45
Victor Nijegorodov7-Apr-23 6:45 
GeneralRe: c++ Pin
Richard MacCutchan7-Apr-23 7:20
mveRichard MacCutchan7-Apr-23 7:20 
GeneralRe: c++ Pin
Victor Nijegorodov7-Apr-23 7:30
Victor Nijegorodov7-Apr-23 7:30 
GeneralRe: c++ Pin
jschell7-Apr-23 9:13
jschell7-Apr-23 9:13 
GeneralRe: c++ Pin
Richard MacCutchan7-Apr-23 21:57
mveRichard MacCutchan7-Apr-23 21:57 
QuestionSnooker Game programing using c Programing. Pin
Francis Lagar3-Apr-23 7:37
Francis Lagar3-Apr-23 7:37 
AnswerRe: Snooker Game programing using c Programing. Pin
Richard MacCutchan3-Apr-23 9:57
mveRichard MacCutchan3-Apr-23 9:57 
AnswerRe: Snooker Game programing using c Programing. Pin
Gerry Schmitz3-Apr-23 10:19
mveGerry Schmitz3-Apr-23 10:19 
AnswerRe: Snooker Game programing using c Programing. Pin
jschell4-Apr-23 6:24
jschell4-Apr-23 6:24 
GeneralRe: Snooker Game programing using c Programing. Pin
Daniel Pfeffer4-Apr-23 7:40
professionalDaniel Pfeffer4-Apr-23 7:40 
SuggestionMessage Closed Pin
29-Mar-23 15:32
Member 1496877129-Mar-23 15:32 
GeneralRe: Socket or file descriptor ? Pin
k505429-Mar-23 17:18
mvek505429-Mar-23 17:18 
GeneralRe: Socket or file descriptor ? Pin
Richard MacCutchan29-Mar-23 21:38
mveRichard MacCutchan29-Mar-23 21:38 
GeneralRe: Socket or file descriptor ? Pin
jschell30-Mar-23 5:45
jschell30-Mar-23 5:45 
GeneralMessage Closed Pin
30-Mar-23 6:28
Member 1496877130-Mar-23 6:28 
GeneralRe: Socket or file descriptor - more questions ? Pin
k505430-Mar-23 9:31
mvek505430-Mar-23 9:31 
QuestionFind X,Y index into 2D array/matrix using an angle and number of cells Pin
imk12326-Mar-23 7:37
imk12326-Mar-23 7:37 
AnswerRe: Find X,Y index into 2D array/matrix using an angle and number of cells Pin
Mircea Neacsu26-Mar-23 8:04
Mircea Neacsu26-Mar-23 8:04 
AnswerRe: Find X,Y index into 2D array/matrix using an angle and number of cells Pin
Gerry Schmitz26-Mar-23 8:50
mveGerry Schmitz26-Mar-23 8:50 
QuestionWhat is the difference in C and C++ in terms of memory management ? Pin
Gulshan Negi20-Mar-23 22:57
professionalGulshan Negi20-Mar-23 22:57 
GeneralRe: What is the difference in C and C++ in terms of memory management ? Pin
Richard MacCutchan21-Mar-23 2:11
mveRichard MacCutchan21-Mar-23 2:11 
AnswerRe: What is the difference in C and C++ in terms of memory management ? Pin
jschell21-Mar-23 5:41
jschell21-Mar-23 5:41 
QuestionC language Pin
Pavani M18-Mar-23 5:24
Pavani M18-Mar-23 5:24 
AnswerRe: C language Pin
Richard MacCutchan18-Mar-23 6:53
mveRichard MacCutchan18-Mar-23 6:53 
AnswerRe: C language Pin
CPallini19-Mar-23 22:33
mveCPallini19-Mar-23 22:33 
Read a line, fgets[^] is your friend.
If the line read is exactly END than your task is complete: report the line, word and character count.
On the other hand, if the line read is not the termination one, then increment the line count, and get the first character (incrementing the character count): if it is a blank then set a flag was_blank = 1; and go on. If it is not a blank then increment the word count and clear the flag: was_blank = 0;.
Go on with the next character (if any): increment the character count and if the character is
  • a blank then set was_blank = 1;
  • not a blank then, depending on the was_blank flag increment the word count (or do nothing), eventually clear the flag: was_blank = 0;
    "In testa che avete, Signor di Ceprano?"
    -- Rigoletto

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.