免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 2555 | 回复: 11
打印 上一主题 下一主题

[C] 对linux操作系统下C语言编程入门的一个小疑问 请进~ [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-03-18 03:24 |只看该作者 |倒序浏览
C语言跟C++的分别在LINUX上大吗?
找了一下资料,
C是面向过程的语言,
C++是C基础上开发的面向对象的语言
我是初学的,没有什么经验,是不是应该学C++比较好一点呢?因为对于新手来说用类来编程应该好很多吧?
请名位大侠指教一下~
还有,QT 4好像是C++的吧??
应该出了很久了,为什么在市场上找不到这样的书呢?我找到的都是3.2的,不过听说4跟3有着极大的差别~~
所以随便问一下~~请问有人看到QT4的书吗?

论坛徽章:
0
2 [报告]
发表于 2007-03-18 06:03 |只看该作者
C语言跟C++的分别在LINUX上大吗?


我觉得你的这个问题,问 Ken Thompson 可能更好。Ken 很适合处理这类问题。

.

论坛徽章:
0
3 [报告]
发表于 2007-03-18 11:37 |只看该作者
不是这样说的~论坛就是大家议论的地方吗?~
每个人的见解都可以说一下的想法的
~先谢了
请大家说一说~

论坛徽章:
0
4 [报告]
发表于 2007-03-18 11:40 |只看该作者
何必问,学了就知道了

论坛徽章:
0
5 [报告]
发表于 2007-03-18 11:50 |只看该作者
.

哦,你问的问题太深奥了。C 和 C++ 是两种语言。无论在哪儿,两种语言都有非常大的差别。首先是标准的差异。C 里很多习以为常的标准,到了 C++ 这边就用不上了。比如 '\0',在 C 里它是一个 int,但在 C++ 中是 char。其次是编程思想的差异。你也提到,C++ 面向对象,C 面向过程。这是主要的编程思想差异。不少细微的差别也只有系统地学完两种语言的某个子集后才能发现出一部分。还有历史的差异。历史把 C 推向了 Unix 发展的风口浪尖,而 C++ 的历史可以参考这一段文字:

Stroustrup began work on C with Classes in 1979. The idea of creating a new language originated from Stroustrup's experience in programming for his Ph.D. thesis. Stroustrup found that Simula had features that were very helpful for large software development, but the language was too slow for practical use, while BCPL was fast but too low-level and unsuitable for large software development. When Stroustrup started working in Bell Labs, he had the problem of analyzing the UNIX kernel with respect to distributed computing. Remembering his Ph.D. experience, Stroustrup set out to enhance the C language with Simula-like features. C was chosen because it is general-purpose, fast, and portable. Besides C and Simula, some other languages which inspired him were ALGOL 68, Ada, CLU and ML. At first, the class, derived class, strong type checking, inlining, and default argument features were added to C via Cfront. The first commercial release occurred in October 1985.[1]

In 1983, the name of the language was changed from C with Classes to C++. New features were added including virtual functions, function name and operator overloading, references, constants, user-controlled free-store memory control, improved type checking, and a new single-line comment style with two forward slashes (//). In 1985, the first edition of The C++ Programming Language was released, providing an important reference to the language, as there was not yet an official standard. In 1989, Release 2.0 of C++ was released. New features included multiple inheritance, abstract classes, static member functions, const member functions, and protected members. In 1990, The Annotated C++ Reference Manual was published. This work became the basis for the future standard. Late addition of features included templates, exceptions, namespaces, new casts, and a Boolean type.

As the C++ language evolved, a standard library also evolved with it. The first addition to the C++ standard library was the stream I/O library which provided facilities to replace the traditional C functions such as printf and scanf. Later, among the most significant additions to the standard library, was the Standard Template Library.

After years of work, a joint ANSI-ISO committee standardized C++ in 1998 (ISO/IEC 14882:1998). For some years after the official release of the standard in 1998, the committee processed defect reports, and published a corrected version of the C++ standard in 2003. In 2005, a technical report, called the "Library Technical Report 1" (often known as TR1 for short) was released. While not an official part of the standard, it gives a number of extensions to the standard library which are expected to be included in the next version of C++. Support for TR1 is growing in almost all currently maintained C++ compilers.

While the C++ language is royalty-free, the standard document itself is not freely available.

http://en.wikipedia.org/wiki/C++


随便哪一种编程语言,只要你能用好,就都是你的工具了。初学就用 Qt,个人认为这不合适。

.

论坛徽章:
0
6 [报告]
发表于 2007-03-18 12:14 |只看该作者
TO
bGFuZ3Vl
先谢谢你发表的回答。
我看了你转发的文章后,因为E文水平不太好,有点问题??
1 看来好像是C写出来的程序应该会比C++要好?运行速度快?
2 不过以现在的科技来说,CPU都什么年代了?快得过头了~~~还在注意那一  ??
3 先去食饭回来再说~~~

论坛徽章:
0
7 [报告]
发表于 2007-03-18 12:20 |只看该作者
原帖由 jd_chen 于 2007-3-18 12:14 发表
TO
bGFuZ3Vl
先谢谢你发表的回答。
我看了你转发的文章后,因为E文水平不太好,有点问题??
1 看来好像是C写出来的程序应该会比C++要好?运行速度快?
2 不过以现在的科技来说,CPU都什么年代了?快得过头了~~~还在注意那一  ??
3 先去食饭回来再说~~~


不是 C 比 C++ 快,也不是 C++ 比 C 快。而只是不同的实现会有不同的执行效率,不同的实现优化的方面也不尽相同。文中提到速度慢的语言是 Simula。C 和 C++ 有很多区别,只有你学了才能进一步了解这些区别

.

论坛徽章:
0
8 [报告]
发表于 2007-03-18 13:38 |只看该作者
原帖由 bGFuZ3Vl 于 2007-3-18 12:20 发表


不是 C 比 C++ 快,也不是 C++ 比 C 快。而只是不同的实现会有不同的执行效率,不同的实现优化的方面也不尽相同。文中提到速度慢的语言是 Simula。C 和 C++ 有很多区别,只有你学了才能进一步了 ...

对于一个,只是想写一个游戏外挂的人来说,学什么比较好一点呢??
就是基本的IP包对答,加上一点流程就是了~~~
因为大部分的时间,要去做解密分析~~~~
最不明白的是,为什么说QT难呢??我看到的资料QT4应该是像。NET那样的吧???
应该比较容易上手才对的呀????

论坛徽章:
0
9 [报告]
发表于 2007-03-18 15:59 |只看该作者
~有朋友可以给点意见我吗/~

论坛徽章:
0
10 [报告]
发表于 2007-03-18 16:01 |只看该作者
建议先学c, 用c写一个复杂点的游戏,
最后楼主再看看c++
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP