I am kinda new to world of c programming, and i have been assigned a problem that is written as follows: Write a procedure that counts the number or words in a string. Write a program to test your new procedure. I am kinda lost on this completely. Any help on how to define the number of words by the amount of spaces. How do i define a word? Where do i want to start. I figure it will involve some form of looping and a counter. Any help will be greatly appreciated
Alfy
0
Newbie Poster
Recommended Answers
Jump to PostThe thing with gets() function at university will be only in first semester,to "accomodate".
In the second semester will have a better teacher
Thanks
Jump to PostThanks so much.It worked. Yeah I know that it is always int main with a return 0 and about indentation, i was so harassed that time that I didn't care. Thanx anyways.
But we do. And so will your boss... ;)
You're welcome!
Jump to Posthow would i get this code to line count also?
Define what a line is and then read upto that. Keep count of how many
times you reach that definition, and your there.
Jump to PostI'm not sure why you want to delete white spaces??
This is a two year old thread, so it's best to start a new thread, and perhaps tell us what you are trying to do, in more detail.
If you will show me your code, I will show …
Jump to Posti need a program in c the program is their is a file in that first we have take 0-9 letters in that we count how many no of a,b,c...,z then we take 1-10 we do the same we do the same sequence until the end of the file.
Sorry …
All 26 Replies
Cup of Squirrel
0
Junior Poster
Alfy
0
Newbie Poster
Windsurfer
0
Newbie Poster
Eko
1
Junior Poster in Training
~s.o.s~
2,560
Failure as a human
Team Colleague
Featured Poster
Eko
1
Junior Poster in Training
iamthwee
~s.o.s~
2,560
Failure as a human
Team Colleague
Featured Poster
Eko
1
Junior Poster in Training
iamthwee
~s.o.s~
2,560
Failure as a human
Team Colleague
Featured Poster
Eko
1
Junior Poster in Training
IwalkAlone
7
Light Poster
Aia
1,977
Nearly a Posting Maven
Salem
5,138
Posting Sage
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
IwalkAlone
7
Light Poster
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
Talkin Tosh
0
Newbie Poster
Aia
1,977
Nearly a Posting Maven
nidhi.2384
0
Newbie Poster
ctype
-4
Newbie Poster
Salem
commented:
Showing up 3 YEARS LATE, with unformatted code (did you even read the intro threads), and using void main makes you a total waste of space
-4
jeunesse_doree1
0
Newbie Poster
Adak
419
Nearly a Posting Virtuoso
Birunda Devi
0
Newbie Poster
zeroliken
79
Nearly a Posting Virtuoso
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.