| | |
Strings
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jun 2005
Posts: 11
Reputation:
Solved Threads: 0
I have a program that I know I need a string to use. Problem is in class we did a program with strings in which we input one name like "Dan" and another name like "dave" and it would say which is bigger, how many characters are in each ect. This new program I have to ask the user to input a sentecne like.. " This book has ten pages" then it would count the number words and senteces in text. Also I would have to ask the user it for a letter like "a" and it would count the lower and upper case letters. I have a program in VB where i would put "Hello" and it tels me how many times "L" is used. (i cant find that disk
)
I am not asking for the whole program need help on how to start it and tips to get me along, because im seriously lost about this whole chapter on strings.
)I am not asking for the whole program need help on how to start it and tips to get me along, because im seriously lost about this whole chapter on strings.
•
•
Join Date: Jun 2005
Posts: 11
Reputation:
Solved Threads: 0
Ok now i understand how to input a string. What about words..this program has to be almsot simlar to microsoft words "word count." I mean I have a program that tells the number of characters in a string. Meaning each letter, but it has to count words a sentence and allow the user to ask for a letter. Then it tells how many times that letter is used.
Now to have it count a sentence I can use a period/ question mark as one of the characters..that way the program will look for a period or question mark and say how many sentences are there. But what about words and letters? It has to be so that the user can type any random sentence and get the number of words in that sentece. I mean it would be easier if it was from file because then i have seen sites that have simliar problems. I ask the professor but he doesnt give me a straight answer. Its annoying and i know i have to figure it out, but without me knowing how to start, it is like im stuck in a ditch. I mean I know the include statemnts to use...just everything else is confusing.
Now to have it count a sentence I can use a period/ question mark as one of the characters..that way the program will look for a period or question mark and say how many sentences are there. But what about words and letters? It has to be so that the user can type any random sentence and get the number of words in that sentece. I mean it would be easier if it was from file because then i have seen sites that have simliar problems. I ask the professor but he doesnt give me a straight answer. Its annoying and i know i have to figure it out, but without me knowing how to start, it is like im stuck in a ditch. I mean I know the include statemnts to use...just everything else is confusing.
![]() |
Similar Threads
- Comparing Strings in C# (C#)
- Please help me compare strings (Java)
- reversing two strings (C)
- C++ handling of strings in a boolean expression (C++)
- Compare strings... (C++)
- comparing two strings with linear search.. (Java)
- JSP and Oracle (JSP)
Other Threads in the C Forum
- Previous Thread: Which is Faster? direct or indirect access?
- Next Thread: array / data comparision help
| Thread Tools | Search this Thread |
* ansi api array arrays bash binarysearch calculate centimeter changingto char character convert copyanyfile copypdffile createcopyoffile createprocess() csyntax directory dynamic fflush file floatingpointvalidation fork forloop frequency getlasterror getlogicaldrivestrin givemetehcodez graphics gtkgcurlcompiling gtkwinlinux hardware highest homework i/o ide inches initialization intmain() iso km license linked linkedlist linux linuxsegmentationfault list logical_drives loopinsideloop. lowest match matrix microsoft motherboard mqqueue multi mysql oddnumber odf 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 strings suggestions test testautomation unix urboc user variable whythiscodecausesegmentationfault win32api windows.h windowsapi





