1

Below is small snippet I have written

int main()
{
    char *c=new char('c');
    int *a = new int(10);
  
    cout <<c<<endl;
    cout <<a<<endl;
    return 0;
}

The output produced is

c                                                                                                                                             
0x217ac40   

Could someone explain why character is printed for c instead of address like a?

Meraj Hussain
  • 338
  • 3
  • 21

0 Answers0