Difference between revisions of "Introduction"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
Warning: C# is needed for the skeleton program, this means that familiarity is needed and knowing C++ may lead to syntax mistakes.
+
== Introduction to C++ ==
  
== Introduction to C++ ==
+
C++ is a language that is similar to C#, it shares much of the syntax and formatting. This is due to C# having been created as an advancement on C++. A key difference that is essential to know is C# is protected, it is far harder to cause serious damage or make inefficient code that causes large slow downs, this differs to C++ which lacks this protection.
  
C++ is a language that is similar to C#, it shares much of the syntax and formatting. This is due to C# having been created as an advancement on C++. A key difference that is essential to know is C# is protected, it is far harder to cause serious damage or make inefficient code that causes large slow downs, this differs to C++ which lacks this protection. Despite the risks working in C++ allows for better interaction with hardware, and better manipulation for memory. This means that when programming something extremely large, or working directly with hardware C++ can be of more use, furthermore knowing C++ allows someone access to almost any aspect of programming.
+
Despite the risks working in C++ allows for better interaction with hardware, and better manipulation for memory. This means that when programming something extremely large, or working directly with hardware C++ can be of more use, furthermore knowing C++ allows someone access to almost any aspect of programming.
  
 
== Differences ==
 
== Differences ==
  
C++ has a feature that is not within C#, '''Pointers'''. A pointer is a direct target at memory, this means that as opposed to recreating something such as an image or passing a reference to where the image is, the program can directly look at the memory; usually returning a hexadecimal string of written to the console.
+
C++ has a feature that is not within C#, '''Pointers'''. A pointer is a direct target at memory, this means that as opposed to recreating something such as an image or passing a reference to where the image is, the program can directly look at the memory; usually returning a hexadecimal string if written to the console.
 +
 
 +
C++ also has headers files with the classes. These files are where variables, methods and functions are all initialised, they then get filled within the class (C++) file.
 +
 
 +
C++ requires use of a few new operators such as the ''' :: ''', this operator is not introduced until university (where C++ is often introduced) and it is one of the most common causes for a program not compiling other then missing a semi-colon for programmers. Other operators are used, however they have different meanings based on the context they are used as the same symbols can be reassigned to completely different meanings.
  
C++ also has headers files with the classes. These files are where variables, methods and functions are all initialised, they then get filled withing the class (C++) file.
+
C++ requires inclusion of many libraries for more basic things, simply outputting to the console requires the use of a library not included in visual studios default C++ template.

Latest revision as of 09:18, 20 June 2019

Introduction to C++

C++ is a language that is similar to C#, it shares much of the syntax and formatting. This is due to C# having been created as an advancement on C++. A key difference that is essential to know is C# is protected, it is far harder to cause serious damage or make inefficient code that causes large slow downs, this differs to C++ which lacks this protection.

Despite the risks working in C++ allows for better interaction with hardware, and better manipulation for memory. This means that when programming something extremely large, or working directly with hardware C++ can be of more use, furthermore knowing C++ allows someone access to almost any aspect of programming.

Differences

C++ has a feature that is not within C#, Pointers. A pointer is a direct target at memory, this means that as opposed to recreating something such as an image or passing a reference to where the image is, the program can directly look at the memory; usually returning a hexadecimal string if written to the console.

C++ also has headers files with the classes. These files are where variables, methods and functions are all initialised, they then get filled within the class (C++) file.

C++ requires use of a few new operators such as the  :: , this operator is not introduced until university (where C++ is often introduced) and it is one of the most common causes for a program not compiling other then missing a semi-colon for programmers. Other operators are used, however they have different meanings based on the context they are used as the same symbols can be reassigned to completely different meanings.

C++ requires inclusion of many libraries for more basic things, simply outputting to the console requires the use of a library not included in visual studios default C++ template.