C++
共 2 篇文章
ubuntu 10 linux c,c++ gtk,qt 环境配置
c==>gtk,c++==>qt 1、配置GCC 刚装好的系统中已经有GCC了,但是这个GCC什么文件都不能编译,因为没有一些必须的头文件,所以要安装build-essential这个软件包,安装了这个包会自动安装上g++,libc6-dev,linux-libc-dev,libstdc++6-4.1-dev等一些必须的软件和头文件的库。 可以在新立得里面搜索build-essential或输入下面命令: sudo apt-get install build-essential touch 一个test.c #include<stdio.h> int main() { printf("Hel…
CSDN上看到关于C++ 指针参数。。无语
在CSDN 上看到这么三个题,下面各种千奇百怪的回答真是参差不齐。。 只能用很无语来回答。 1。void GetMemory(char *p) { p = (char *)malloc(100); } void Test(void) { char *str = NULL; GetMemory(str); strcpy(str, "hello world"); printf(str); } 2。char *GetMemory(void) { char p = "hello world"; return p; } void Test(void) { char *str = NULL; str =…
2010-04-15 17:30 · C++ · C · C++ · C#