0

my code is

 #include<iostream>

 using namespace std;

 int main()
{
int size;

cout << "enter number of letters in your name\t:";

cin >> size;

char *array = new char[size];

cin.getline( array, size);

for (int i = 0; i <= size; i++)

    cout <<'\n'<< array[i];

delete[] array;

cin.get();
}

and my output is some weird thing

enter number of letters in your name    :5


/
 ≥

└
ramsay

and after this execution stops, for loop is newer executed.

I know i am using old styled string but we have to use this as recommended by our high school

ramsay
  • 101
  • 1

0 Answers0