如何将字符串类型写入C [英] How to write string type to C
本文介绍了如何将字符串类型写入C的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好所有访客
我对C有疑问.
我是C的初学者.
我想在C变量中写"Hello".
我曾经这样与vb合作.
Hi all visitors
i have problem with C.
i am the beginner of C.
i want to write "Hello" to variable in C.
i have worked with vb like this.
Dim str as string
str="Hello"
因此str变量将存储"Hello",我可以使用msgbox这样显示该字符串.
so str variable will store "Hello" and i can display that string by using msgbox like this.
msgbox (str)
我该如何在C语言中做到这一点?
谢谢
how can i do that in C?
Thanks
推荐答案
const char * str ="Hello";
:: MessageBox(NULL,str,"tip",MB_OK);
const char* str = "Hello";
::MessageBox(NULL,str, "tip", MB_OK);
这篇关于如何将字符串类型写入C的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文