cin.getline() equivalent when getting a char from a function.

Posted by Aaron on Stack Overflow See other posts from Stack Overflow or by Aaron
Published on 2012-04-14T23:24:01Z Indexed on 2012/04/14 23:30 UTC
Read the original article Hit count: 140

Filed under:
|
|

From what I understand cin.getLine gets the first char(which I think it a pointer) and then gets that the length. I have used it when cin for a char. I have a function that is returning a pointer to the first char in an array. Is there an equivalent to get the rest of the array into a char that I can use the entire array. I explained below what I am trying to do. The function works fine, but if it would help I could post the function.

cmd_str[0]=infile();// get the pointer from a function
cout<<"pp1>";
cout<< "test1"<<endl;
//  cin.getline(cmd_str,500);something like this with the array from the function                                                   
cout<<cmd_str<<endl; this would print out the entire array
cout<<"test2"<<endl;
length=0;
length= shell(cmd_str);// so I could pass it to this function   

© Stack Overflow or respective owner

Related posts about c++

Related posts about arrays