Created
March 17, 2018 16:20
-
-
Save kilon/925d5ecc5f40fdf85979289d8dcf811d to your computer and use it in GitHub Desktop.
C++ string to C string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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