Operating System - HP-UX
1833772 Members
2680 Online
110063 Solutions
New Discussion

Re: C , CANSI & C++ .doubts and Queries!!!

 
SOLVED
Go to solution
rveri
Super Advisor

C , CANSI & C++ .doubts and Queries!!!

Dear experts,

The doubt is ,

1)What is the difference between C and C++ ?,

2)CANSI is available in all HP-UX ver. ,
I can compile C programs very well.
But can I compile my C++ source program in CANSI ?

3) If I know C , can i write program for C++ ?

Can anyone focus some light on C and C++ it,



R Veri.


4 REPLIES 4
Antoniov.
Honored Contributor

Re: C , CANSI & C++ .doubts and Queries!!!

Hello,

1) C is a traditinal 3G language; mainly is used to write low level code (driver, OS, etc.); C++ is 4G language, based on OOPS (Object Oriented Programming System). C++ give more powerful to programmer.

2)AFAIK, C++ is not full ANSI standard; library of C++ are not standard while language syntax is coded.

3) Yes, but you need learn about C++ and before this you must learn about OOPS. C++ and C have same syntax but different programming concept.

At last, more C++ precompiler make a C source code.

H.T.H.
Antonio Vigliotti
Antonio Maria Vigliotti
R. Sri Ram Kishore_1
Respected Contributor

Re: C , CANSI & C++ .doubts and Queries!!!

Hi Veri,

Here are my answers to ur qs:

1)Check out the following links:
a)HP C++ Programmer's Guide
http://docs.hp.com/hpux/onlinedocs/92501-90029/92501-90029.html
(--->Overview of HP C++ ---> How C++ differs from C).
b) http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1047588051&id=1043284376
c) http://www.faqs.org/qa/qa-117.html
d) http://archives.seul.org/linuxgames/Nov-2002/msg00031.html
e) http://www.devx.com/tips/Tip/5590

2) Starting HP-UX 11i v2, the HP aC++ compiler, version A.05.50, combines aC++ and C compiler into one. It provides a common C++/ANSI C compiler with a very high level of compatibility with the previous release of the HP C compiler. Refer to the following docs for more information:
- http://docs.hp.com/hpux/onlinedocs/B3901-90008/B3901-90008.html
- http://docs.hp.com/hpux/onlinedocs/5187-2289/5187-2289.html

3) You will need to learn OOPS, and atleast understand the difference between C++ and C very well, before attempting to do so.

Hope this helps.

Regards,
Sri Ram
"What goes up must come down. Ask any system administrator."
Manish Srivastava
Trusted Contributor
Solution

Re: C , CANSI & C++ .doubts and Queries!!!

Hi,

1) What is the difference between C and C++ ?
C is a procedural language based on functions. C++ is an object oriented language the conceps of objects.

2) CANSI is available in all HP-UX ver. ,
I can compile C programs very well.
But can I compile my C++ source program in CANSI ?
CANSI I assume you mean ANSI C. On all HP-UX boxed the cc available is not an ANSI C compiler. ANSI C compiler needs to be bought separately.
You cannot complile your C++ programs on that compiler.


3) If I know C , can i write program for C++ ?

Yes and no. C programs can be compiled by the C++ compiler so in a way you can use the C++ compiler to compile C programs.
No because you need the object concept to write effective C++ programs.


manish
Ravi_8
Honored Contributor

Re: C , CANSI & C++ .doubts and Queries!!!

Hi,

1> C is a procedural language whereas C++ is object oriented language(OOPs)

2> No

3>C++ is the extension of C, you need to learn C++, But knowing C helps in C++
never give up