Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
C++ string to C string
// ConsoleApplication1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
std:string some = "but";
char *foo = &some[0];
cout << "Hello, World!";
printf(foo);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.