I have written this c++ progam . I want the string entered toappear when i call
ID: 3615214 • Letter: I
Question
I have written this c++ progam . I want the string entered toappear when i call getvowel and after i call getStringFromUser(); iam able to accept the string but unable to understand why i am notable to print them.i want getstringfromuser to return char*The program is as follows
#include<iostream>
using namespace std;
#include <string>
using std::string;
char* getStringFromUser()
{
cout<<"Enter a string";
char str[100];
char* str1="";
cout<<"enter a stiring"<<endl;
cin.get(str,80);
str1=str;
cout<<endl;
cout<<"input string is";
for(;*str1 !='';str1++)
cout<<*str1;
return str1;
}
void getvowel(char* two)
{
cout<<"input string getvowel"<<endl;
for(;*two !='';two++)
cout<<*two; // I wnat the print input string
}
void main()
{
char* strng=getStringFromUser();
cout<<endl<<"input string is main"<<endl;
for(;*strng !='';strng++)
cout<<*strng; // I wnat the printinput string
getvowel(strng);
}