| | |
count number of characters program in C
![]() |
•
•
Join Date: May 2008
Posts: 538
Reputation:
Solved Threads: 86
We like to help those that show some effort, especially when it appears to be an assignment.
Show us what you've tried. Tell us what it does and what you expected it to do and we can help you make the two match up better.
(I wouldn't be surprised to find an example program kicking around here somewhere...did you do a search before you started a topic?)
Show us what you've tried. Tell us what it does and what you expected it to do and we can help you make the two match up better.
(I wouldn't be surprised to find an example program kicking around here somewhere...did you do a search before you started a topic?)
•
•
Join Date: Sep 2009
Posts: 3
Reputation:
Solved Threads: 0
•
•
•
•
We like to help those that show some effort, especially when it appears to be an assignment.
Show us what you've tried. Tell us what it does and what you expected it to do and we can help you make the two match up better.
(I wouldn't be surprised to find an example program kicking around here somewhere...did you do a search before you started a topic?)
C Syntax (Toggle Plain Text)
#include <stdio.h> int main() { int i ; int c; while ( ( i = getchar() ) != EOF ) c++ ; printf( "%d characters\n" , c) ; return 0; }
does this seem ok? ... when i run it ./a.out i click enter
then i enter a word say "daniweb" and press enter and then hit ctrl+d and it says 8 characters
Last edited by bbballin; Sep 29th, 2009 at 8:04 pm.
•
•
•
•
sorry i forgot to post my code
C Syntax (Toggle Plain Text)
#include <stdio.h> int main() { int i ; int c; while ( ( i = getchar() ) != EOF ) c++ ; printf( "%d characters\n" , c) ; return 0; }
does this seem ok? ... when i run it ./a.out i click enter
then i enter a word say "daniweb" and press enter and then hit ctrl+d and it says 8 characters
I give up! 1) What word becomes shorter if you add a letter to it? [ Solved by : niek_e ] 2) What does this sequence equal to : (.5u - .5a)(.5u-.5b)(.5u-.5c) ... 3) What is the 123456789 prime numer? Ask4Answer
![]() |
Similar Threads
- can anyone give me simple example for SERIAL NUMBER to activate the program?? (VB.NET)
- How to Count number of liens and Characters in a Tiff image .... (C#)
- Code correction - counting characters. (Python)
- character counting program is driving me nuts! (C++)
- Count the number of 2s in an integer (C)
- Count characters of a string. (C++)
- Count number of occurrences of a character search it in a file (C++)
- returning number of characters with ASCII code (C)
- character count (C++)
- run program and rename file script help please (Shell Scripting)
Other Threads in the C Forum
- Previous Thread: isAnagram() function in C
- Next Thread: c program
| Thread Tools | Search this Thread |
* ansi api array arrays bash binarysearch calculate centimeter changingto char character convert copyanyfile copypdffile createcopyoffile createprocess() directory dynamic execv fflush file floatingpointvalidation fork forloop frequency function getlasterror getlogicaldrivestrin givemetehcodez grade graphics gtkgcurlcompiling gtkwinlinux hardware highest histogram homework i/o ide inches infiniteloop initialization input intmain() iso keyboard km license linked linkedlist linux list looping loopinsideloop. lowest matrix microsoft mysql oddnumber open opendocumentformat openwebfoundation pdf pointer pointers posix power program programming pyramidusingturboccodes read recursion recv recvblocked repetition reversing scanf scheduling segmentationfault send shape single socketprogramming stack standard strchr string suggestions test testautomation threads unix urboc user variable whythiscodecausesegmentationfault win32api windows.h windowsapi






