Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<string> // 請注意在DEV C++中只接受#include<string.h>,因此DEV C++中不需要這一行
- #include<string.h> // 在Visual Studio使用#include<string>
- #include<iostream> // printf()
- using namespace std;
- int main()
- {
- // 字串的宣告
- string myString = "abc";
- // 印出字串(請注意語法)
- printf("%s\n", &myString[0]);
- }
Add Comment
Please, Sign In to add comment