This code only print characters until char value is 0 but surprisingly it output characters only upto first blank space.
I checked their ASCII values and surprisingly ASCII value of space(' ') character was output by program as 0.
I couldn't get it. Any help is appreciated.
#include <iostream>
#include <sstream>
using namespace std;
int main()
{
try
{
char* str=new char[100]; //char* str=new char[100000000000000000];
cin>>str;
char*sec=str;
while(*sec)
{
sec++;
cout<<int(*sec)<<' ';
}
cout<<endl;
cout<<str<<endl;
delete[] str;
}
catch(exception& e)
{
cout << "Standard exception: "<<e.what()<<endl;
}
}