#include <iostream> #include <stdlib.h> using namespace std; int main ( int argc, char *argv[] ) { int a; typeof(a) b = 14; cout<<b<<endl; return EXIT_SUCCESS; } /* ---------- end of function main ---------- *
#include <iostream> #include <stdlib.h> using namespace std; int main ( int argc, char *argv[] ) { char* sstr = "Hello World!"; char dstr[40]; memcpy(dstr, sstr, strlen(sstr)); dstr[strlen(sstr)] = 0; cout<<dstr<<endl; return EXIT_SUCCESS; } /* ---------- end of function main ---------- *
本文提供了两个使用C++编写的简单程序示例:第一个程序展示了如何声明变量并输出其值;第二个程序则演示了字符串复制的过程及输出结果。

474

被折叠的 条评论
为什么被折叠?



