How do i input(cin) char array for example name[100] and user inputs "Mike Jordan" and the computer scans the whole line and stores it in name[100]. It must store the whole name including the space so when i cout it, it outputs whole name with space "Mike Jordan".
#include<iostream>
#include<string>
usingnamespace std;
int null(char name[500]) //Function for getting a number of how many digits/charachters "name" of title is made of.
{
int i;
for(i=0;name[i]!='\0';i++);
return i;
}
int main()
{
char name[500];
cout << "Title:";
//here i want to input it but i dont know how (getline is not working)
cout << "Title is made of " << null(name) << " signs." << endl;
return 0;
}