| | |
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?![]() |
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 |
* adobe api array arrays binarysearch calculate centimeter char cm convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory dynamic feet fflush file floatingpointvalidation fork forloop frequency getlasterror getlogicaldrivestrin givemetehcodez global graphics gtkgcurlcompiling gtkwinlinux hacking hardware highest homework i/o ide inches incrementoperators intmain() iso km linked linkedlist linux linuxsegmentationfault list locate logical_drives loopinsideloop. match matrix microsoft motherboard mqqueue mysql oddnumber odf open opendocumentformat opensource openwebfoundation pattern pdf performance pointer posix power program programming pyramidusingturboccodes read recursion recv recvblocked repetition scanf scheduling segmentationfault send shape single socketprograming socketprogramming stack standard strchr string suggestions test unix urboc user variable voidmain() whythiscodecausesegmentationfault win32api windows.h






