d****p 发帖数: 685 | 1 There is so much stuff about how to learn C++ as C coders. Howerver, little
can be found about becoming a
good C coder as a C++ coder.
Anyone cares to offer oponions? |
g*****g 发帖数: 34805 | 2 C is part of C++
little
【在 d****p 的大作中提到】![](/moin_static193/solenoid/img/up.png) : There is so much stuff about how to learn C++ as C coders. Howerver, little : can be found about becoming a : good C coder as a C++ coder. : Anyone cares to offer oponions?
|
t****t 发帖数: 6806 | 3 for syntax, you may say c++ is a superset of c
but they are totally different language.
【在 g*****g 的大作中提到】![](/moin_static193/solenoid/img/up.png) : C is part of C++ : : little
|
t****u 发帖数: 8614 | 4 Nod!
Procedure based vs. OO, the concept is totally different.
【在 t****t 的大作中提到】![](/moin_static193/solenoid/img/up.png) : for syntax, you may say c++ is a superset of c : but they are totally different language.
|
a****o 发帖数: 686 | 5 又见 master shifu。
【在 t****t 的大作中提到】![](/moin_static193/solenoid/img/up.png) : for syntax, you may say c++ is a superset of c : but they are totally different language.
|
l******e 发帖数: 12192 | 6 原来是这个滴马甲
【在 a****o 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 又见 master shifu。
|
b******n 发帖数: 592 | 7 I would say they are two different thing, especially from C to c++,
so many assumptions in C is no longer valid in C++.. if you want to
write C++, write it in C++ way..
C is smaller than C++ and quite stable, it is easier to understand what
compiler
does to C program.
【在 g*****g 的大作中提到】![](/moin_static193/solenoid/img/up.png) : C is part of C++ : : little
|
g*****g 发帖数: 34805 | 8 C++ doesn't exactly need C syntax in it, but since it does,
real world C++ codes do have lots of C code in it.
As a result, every good C++ coder knows C fairly well.
【在 b******n 的大作中提到】![](/moin_static193/solenoid/img/up.png) : I would say they are two different thing, especially from C to c++, : so many assumptions in C is no longer valid in C++.. if you want to : write C++, write it in C++ way.. : C is smaller than C++ and quite stable, it is easier to understand what : compiler : does to C program.
|
r*********r 发帖数: 3195 | 9 做一个合格的 c 程序员, 最重要的是把 posix api 搞熟. |
m********l 发帖数: 4394 | 10 yea...
you have to deal with a lot of limitations.
you need to memorize them.
little
【在 d****p 的大作中提到】![](/moin_static193/solenoid/img/up.png) : There is so much stuff about how to learn C++ as C coders. Howerver, little : can be found about becoming a : good C coder as a C++ coder. : Anyone cares to offer oponions?
|
|
|
h***i 发帖数: 1970 | 11 说superset也不准确,
struc fs_ops
{
.open = fs_open,
.write = fs_write
}
这个C++就不支持。
【在 t****t 的大作中提到】![](/moin_static193/solenoid/img/up.png) : for syntax, you may say c++ is a superset of c : but they are totally different language.
|
r****o 发帖数: 1950 | 12 what does .open and .write mean?
【在 h***i 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 说superset也不准确, : struc fs_ops : { : .open = fs_open, : .write = fs_write : } : 这个C++就不支持。
|
t****t 发帖数: 6806 | 13 that's c99. c99 does have some syntax extension (which c++ doesn't have).
but obviously current c++ standard is before c99. lol
BTW the correct syntax is
struct S s={.open=fs_open, .write=fs_write};
【在 h***i 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 说superset也不准确, : struc fs_ops : { : .open = fs_open, : .write = fs_write : } : 这个C++就不支持。
|
r****o 发帖数: 1950 | 14 the same as function pointers?
【在 t****t 的大作中提到】![](/moin_static193/solenoid/img/up.png) : that's c99. c99 does have some syntax extension (which c++ doesn't have). : but obviously current c++ standard is before c99. lol : BTW the correct syntax is : struct S s={.open=fs_open, .write=fs_write};
|
d****p 发帖数: 685 | 15 Looks like .a equivalent to this->a. And suporting partial initializing C
structure? More readable?
First time saw this - that's too much for my poor C knowledge gained 10+
years ago
【在 r****o 的大作中提到】![](/moin_static193/solenoid/img/up.png) : the same as function pointers?
|
a**e 发帖数: 5794 | 16 C有一些很不方便的地方,比如
1. 没有namespace,函数得用很长的名字。
2. 没有内存管理。
3. 返回一个数组需要malloc,还得返回数组长度,因为数组没有.length或size之类的
属性。
4. 如果一个struct包含flexible array member,不能直接初始化这个struct的数组。
这些问题都可以绕过去,但是绕过去的方法不够优雅。
little
【在 d****p 的大作中提到】![](/moin_static193/solenoid/img/up.png) : There is so much stuff about how to learn C++ as C coders. Howerver, little : can be found about becoming a : good C coder as a C++ coder. : Anyone cares to offer oponions?
|
d****p 发帖数: 685 | 17 Thank all guys answering my question. Now I have a slightly updated
knowledge on C :-)
【在 a**e 的大作中提到】![](/moin_static193/solenoid/img/up.png) : C有一些很不方便的地方,比如 : 1. 没有namespace,函数得用很长的名字。 : 2. 没有内存管理。 : 3. 返回一个数组需要malloc,还得返回数组长度,因为数组没有.length或size之类的 : 属性。 : 4. 如果一个struct包含flexible array member,不能直接初始化这个struct的数组。 : 这些问题都可以绕过去,但是绕过去的方法不够优雅。 : : little
|
v*s 发帖数: 946 | 18 C++貌似也没有内存管理。
除非你要用shared_ptr。
【在 a**e 的大作中提到】![](/moin_static193/solenoid/img/up.png) : C有一些很不方便的地方,比如 : 1. 没有namespace,函数得用很长的名字。 : 2. 没有内存管理。 : 3. 返回一个数组需要malloc,还得返回数组长度,因为数组没有.length或size之类的 : 属性。 : 4. 如果一个struct包含flexible array member,不能直接初始化这个struct的数组。 : 这些问题都可以绕过去,但是绕过去的方法不够优雅。 : : little
|
v*s 发帖数: 946 | 19 请教“4” 是啥意思? C++能做吗?
【在 a**e 的大作中提到】![](/moin_static193/solenoid/img/up.png) : C有一些很不方便的地方,比如 : 1. 没有namespace,函数得用很长的名字。 : 2. 没有内存管理。 : 3. 返回一个数组需要malloc,还得返回数组长度,因为数组没有.length或size之类的 : 属性。 : 4. 如果一个struct包含flexible array member,不能直接初始化这个struct的数组。 : 这些问题都可以绕过去,但是绕过去的方法不够优雅。 : : little
|
d***q 发帖数: 1119 | 20 the compelling feature of C/C++ is programmer taking over memory management.
so even you use smart pointer you still need to have a knowledge what kind
of smart pointer you need to use: shared_ptr? weak_ptr? intrusive_ptr?
for any language with GC support. these choices will be made easily.
【在 v*s 的大作中提到】![](/moin_static193/solenoid/img/up.png) : C++貌似也没有内存管理。 : 除非你要用shared_ptr。
|
c**b 发帖数: 2999 | 21 C: procedural language
java: object-orientated language
c++: hybrid of both
little
【在 d****p 的大作中提到】![](/moin_static193/solenoid/img/up.png) : There is so much stuff about how to learn C++ as C coders. Howerver, little : can be found about becoming a : good C coder as a C++ coder. : Anyone cares to offer oponions?
|