Can somebody help me in converting some elements of char array[] into String.
I'm still learning strings.
char input[40] = "save filename.txt";
int j;
string check;
for (int i = 0; input[i] != '\0'; i++)
{
if (input[i] == ' ')
{
j = i+1;
break;
}
}
int index;
for (int m = 0; arr[j] != '\0'; m++)
{
check[m] = arr[j];
j++;
index = m; //to store '\0' in string ??
}
check[index] = '\0';
cout << check; //now, String should output 'filename.txt" only
stringtoStringand removed a potential example.stringString? Your changes were not significantly better in my opinion, and I would not have approved them had I seen them before they took place.