please help me!

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2007
Posts: 4
Reputation: zizimetalique is an unknown quantity at this point 
Solved Threads: 0
zizimetalique zizimetalique is offline Offline
Newbie Poster

please help me!

 
0
  #1
Dec 12th, 2007
i have to write the count_sentence and the to_lower function assuming the the first parameter is the character array holding the text. The count_sentences function should find the number of sentences in the text by counting periods, question marks, and exclamation points. so far this is the code that i have please help completing this code !


#include <iostream.h>

void get_text(char t[]);

//

// Put

// Prototypes

// Here

//

//

void main()

{

char text[81];

int sentences;

get_text(text);

sentences = count_sentences(text);

to_lower(text);

cout << “There are “<< sentences << “ in this text” <<endl;

cout << text;

}

void get_text(char t[])

{

int i;

cout << “Enter a line of text”;

i=0;

cin.get(t[i]);

while (t[i]!=’\n’) {

++i;

cin.get(t[i]);

}

t[i] = ‘\0’;

}
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,648
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1498
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: please help me!

 
0
  #2
Dec 12th, 2007
>>void main()
Not valid code. use int main() instead.

all you have to do is write two functions. Please show us the code YOU have written to complete that assignment. We will NOT do your homework for you, but will gladly help you write it yourself.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 467 | Replies: 1
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC