C&c++ Recap

Source: Internet
Author: User

I learned C + + in my freshman years, but I forgot about it, and seldom used it. The Windows system was used, or Visual C + +. At that time, the computer did not have a cold, and did not study well. Recently in the study of R encountered bottlenecks, think to pick up the once C + +. Now the time has changed, the system for Mac, the previous knowledge has already forgotten all, can only start again.

1. IDE

It's good to choose Eclipse CDT. A few notes:

A. Inconsistencies in C and C + +:

If you create a source file, the end of C is. c, and C + + files end With. cpp;

The syntax is inconsistent, and the simplest Hello world can see:

//C + + code#include<iostream>using namespacestd;intMain () {cout<<"!!! Hello World!!!"<< Endl;//Prints!!! Hello World!!!    return 0;}//C Code#include <stdio.h>//". h" must is added for CMain () {printf ("Hello World");}

B. Compiler selection:

Select MacOSX GCC to

Sometimes the compiler has some problems, it is said to be related to MacOS system, try to double-click binary file on work

If you are compiling directly with the compiler, be aware of the differences between C and C + + files:

    

GCC file g+ + HelloWorld. CPP file

C&c++ Recap

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.