Does anybody know anyway ?
11 replies to this topic
#1
Posted 16 April 2010 - 10:32 AM
|
|
|
#2
Posted 16 April 2010 - 10:48 AM
99% of C code is valid C++ code.
#3
Posted 16 April 2010 - 11:36 AM
cout , cin different with printf scanf :(
#4
Posted 16 April 2010 - 11:43 AM
delphiproblematic said:
cout , cin different with printf scanf :(
#5
Posted 17 April 2010 - 05:50 AM
delphiproblematic said:
cout , cin different with printf scanf :(
#6
Posted 17 April 2010 - 08:56 PM
The largest problem converting c to c++ is typecasting void* return values, such as the return value of malloc(). c++ requires typecast, c does not.
You might also want to read some of these links, which discuss the problems you might encounter.
You might also want to read some of these links, which discuss the problems you might encounter.
Visit Grandpa's Forums, a social networking forum, with family-oriented arcade games, blogs, discussion forums, and photo albums.
#7
Posted 18 April 2010 - 11:25 AM
only bad coding is a problem when converting c to c++. the truth is c++ is just better, and has many functions that replace c functions. more than 99% of your c code is valid, but some purists hate seeing c code in c++ programs. bottom line is it really doesn't matter if you want to update it with new functions or not its up to you.
#8
Posted 19 April 2010 - 11:33 AM
C++ = C + V + OOP
simple, not ?
from .c works to .cpp there are some changes:
1. C-STYLE structures are not supported
2. C-STYLE MACRO is not supported (you might never use this these days)
and to work that out you go on with these steps:
1. put all of your C codes into functions like this,
simple, not ?
from .c works to .cpp there are some changes:
1. C-STYLE structures are not supported
2. C-STYLE MACRO is not supported (you might never use this these days)
and to work that out you go on with these steps:
1. put all of your C codes into functions like this,
#ifdef __cpp__
extern "C" {
#endif
// C functions OR code
#ifdef __cpp__
};
#endif
#9
Posted 19 April 2010 - 12:40 PM
omega said:
C++ = C + V + OOP
simple, not ?
from .c works to .cpp there are some changes:
1. C-STYLE structures are not supported
2. C-STYLE MACRO is not supported (you might never use this these days)
and to work that out you go on with these steps:
1. put all of your C codes into functions like this,
simple, not ?
from .c works to .cpp there are some changes:
1. C-STYLE structures are not supported
2. C-STYLE MACRO is not supported (you might never use this these days)
and to work that out you go on with these steps:
1. put all of your C codes into functions like this,
#ifdef __cpp__
extern "C" {
#endif
// C functions OR code
#ifdef __cpp__
};
#endif
#10
Posted 19 April 2010 - 12:47 PM
omega said:
1. C-STYLE structures are not supported
Wrong. structures are still supported.
omega said:
2. C-STYLE MACRO is not supported (you might never use this these days)
omega said:
1. put all of your C codes into functions like this,
#ifdef __cpp__
extern "C" {
#endif
// C functions OR code
#ifdef __cpp__
};
#endif
That's only necessary if you want to call the C functions compiled as C code from functions compiled as c++ code. When you compile the c code with c++ compiler then that is not necessary.
Visit Grandpa's Forums, a social networking forum, with family-oriented arcade games, blogs, discussion forums, and photo albums.
#11
Posted 19 April 2010 - 04:14 PM
Ancient Dragon said:
Wrong. structures are still supported.
wrong again.
That's only necessary if you want to call the C functions compiled as C code from functions compiled as c++ code. When you compile the c code with c++ compiler then that is not necessary.
wrong again.
That's only necessary if you want to call the C functions compiled as C code from functions compiled as c++ code. When you compile the c code with c++ compiler then that is not necessary.
#12
Posted 20 April 2010 - 11:39 AM
omega said:
1. C-STYLE structures are not supported
2. C-STYLE MACRO is not supported (you might never use this these days)
and to work that out you go on with these steps:
1. put all of your C codes into functions like this,
2. C-STYLE MACRO is not supported (you might never use this these days)
and to work that out you go on with these steps:
1. put all of your C codes into functions like this,
#ifdef __cpp__
extern "C" {
#endif
// C functions OR code
#ifdef __cpp__
};
#endif
this:
#ifdef __cpp__
extern "C" {
#endif
// C functions OR code
#ifdef __cpp__
};
#endif
should be
#ifdef __cpp__
extern "C" {
#endif
// C functions OR code
#ifdef __cpp__
}
#endif
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









