Hey, How would I search the whole line of text.


No replies
Vrutin
Vrutin's picture
Offline
Joined: 2011-10-07
Points: 0

Hey, Wibit's ! I am newbie / begginer.

I just looked at the variables and control structures videos from our best men's: Brian and Kevin.

I kind of came up with my own idea from that, which is more like grammer correction.

My program wants to do: Get line of text from the user, when user enter the line. It needs to go through a checking where it checks for words that should have been capitals. Ie, Names: kevin should be Kevin much like the word correction. 

Here is my current code:

#include <iostream>

#include <stdio.h>

#include <string.h>

 

using namespace std;

 

int MAXNAMES = 5;

 

int main()

{

string names[MAXNAMES] = {"Vrutin","Charlie","Johnson","Vicky"};

char text[100];

gets(text);

 

for(int i=0; i<MAXNAMES[i]; i++)

{

Yes, its a blank loop as I cant seem to understand how I would go around this.

}

 

printf("You Typed The Following: %s", text);

 

 

cin.get();

return 0;

}