0

why isn't this code working

#include <iostream> #include<string> using namespace std; int main() { char *p='this'; cout << *p; cout << p; return 0; }

3rd Jul 2017, 5:39 PM
‎ ‏‏‎Anonymous Guy
3 Answers
0
Please describe what happens when you run this program, and what do you expect instead.
3rd Jul 2017, 6:34 PM
Igor B
Igor B - avatar
0
You also need the String class not the char class.
3rd Jul 2017, 7:23 PM
josh mizzi
josh mizzi - avatar
- 1
You just have to change the simple quotes by double quotes because it is a string.
3rd Jul 2017, 5:45 PM
Jojo