Im trying to convert a lower case string to all uppercase using the ascii table.. I ask the user to input a string which i then put into an array of char's.
The printing of the uppercase version is where im having trouble i can get it to print the first word of the sting but nothing more its like its stopping the array after the first white space.. its prob a simple fix that ill be like ahhh i should have got that but its just tricking me up at the moment.. any help will be muchly appreciated.
#include <iostream>
usingnamespace std;
using std::cout;
using std::endl;
#include <ctype.h>
#include <stdio.h>
int main()
{
char s1[50];
int i=0;
cout<< "Please now enter a String in lowercase: "<<endl;
cin>> s1;
for (int i=0; s1[i]; i++)
{
s1[i] = toupper (s1[i]);
}
cout<<s1[7]<<endl;//Trying to see whats in position 7 of the array.
cout<<"the upperCase version is: "<<s1<<endl;