c++ input/output stream

I/O stream:

#include<iostream>
using namespace std;

int main(){

char name[50],age;
cout<<"enter name:";
cout<<"Age:";
cin>>name>>age;
cout<<"Name: "<<name<<endl<<"Age: "<<age<<endl;
return 0;
}

cerr:

#include<iostream>
using namespace std;

int main(){

char str[]={"unable to read"};
cerr<<"Error msg: "<<str<<endl;
return 0;
}

clog:

#include<iostream>
using namespace std;

int main(){

char str[]={"unable to read"};
clog<<"Error msg: "<<str<<endl;
return 0;
}

 

It would be a great help, if you support by sharing :)
Author: zakilive

Leave a Reply

Your email address will not be published. Required fields are marked *