I have tried most of the string and char format types and they are not working and I have no Idea why. Here is my code :
#include <iostream>
#include <stdio.h>
using namespace std;
int main(int argc, const char * argv[])
{
// insert code here...
string string2;
string string;
cout << "Hello, World!\n";
printf("Hi my name is Josh %s\n",string2);
scanf("%s",&string);
printf("hi %s",string);
}
scanf's%sformat specifier requires a matching character array parameter, not astd::string.std::getline(std::cin, string2);