muhammad afiq bin mohd zimahdi - job sheet 05.docx

12
Fundamental of C++ Question / Discussion 1. Open programming C++

Upload: aana-solehah

Post on 09-Feb-2016

254 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Muhammad Afiq bin Mohd Zimahdi - Job Sheet 05.docx

Fundamental of C++

Question / Discussion

1. Open programming C++

Page 2: Muhammad Afiq bin Mohd Zimahdi - Job Sheet 05.docx

2. Open Dev-C++

Page 3: Muhammad Afiq bin Mohd Zimahdi - Job Sheet 05.docx

3. Write this program

/*this is a program that computes te sum of two integernumber*/

#include <iostream>#include <stdlib.h>int main()

{int X , Y , sum;std::cout <<"nEnter first numer:";std::cin >> X ;std::cout <<"nEnter second number:";std::cin >> Y ;sum = X + Y;std::cout <<"\nsum =" <<sum ;return 0 ;

}

Page 4: Muhammad Afiq bin Mohd Zimahdi - Job Sheet 05.docx

4. Run The project

Page 5: Muhammad Afiq bin Mohd Zimahdi - Job Sheet 05.docx

5. Save the file under Fiq C++

Page 6: Muhammad Afiq bin Mohd Zimahdi - Job Sheet 05.docx

6. Compilation Process

Page 7: Muhammad Afiq bin Mohd Zimahdi - Job Sheet 05.docx

7. Execute the program

Page 8: Muhammad Afiq bin Mohd Zimahdi - Job Sheet 05.docx

8. Insert the data and the result SUM show up

Page 9: Muhammad Afiq bin Mohd Zimahdi - Job Sheet 05.docx

Question / Discussion

9. How ToI . Compilation process

You also can Click F9 to Keyword on Keyboard.

Page 10: Muhammad Afiq bin Mohd Zimahdi - Job Sheet 05.docx

ii. Execute the program

Page 11: Muhammad Afiq bin Mohd Zimahdi - Job Sheet 05.docx

2.What is C++ Programming

C++ is an object oriented programming (OOP) language, developed by Bjarne Stroustrup, and is an extension of C language. It is therefore possible to code C++ in a "C style" or "object-oriented style."

Conclusion:-

Managed Extensions for C++ code enables the functionality of existing unmanaged code to be used in the common language runtime by clients of the managed classes. The clients can be written in any .NET Framework-compliant language, such as Managed Extensions for C++, Visual Basic, and Visual C#.This guide provides an introduction to techniques for interoperating with native C++ code in .NET Framework applications via Managed Extensions for C++.Part I of this guide is an introduction to techniques for wrapping unmanaged C++ classes with Managed Extensions for C++ classes that act as proxies.We have discussed typical techniques for wrapping constructors, the destructor, member functions, binary operators, and assignment and copy constructors. Techniques for wrapping virtual functions, and wrapping in the presence of inheritance are not covered here. The actual techniques used will depend on the unmanaged C++ class that is being wrapped, and may differ from those discussed here.Part II discusses the use of Platform Invocation Services, or PInvoke, provided by the runtime. PInvoke provides a direct way to use functions in existing native C++ DLLs in a managed application written with Managed Extensions for C++.Managed Extensions can also be used to directly wrap the underlying C++ class of a COM object. This can provide better performance than using the COM interface and a runtime callable wrapper because there can be less interoperability overhead and much closer control of how members are wrapped. For some COM objects, it may not be possible to use the Type Library Importer (Tlbimp.exe) to create an assembly for the COM object, and using Managed Extensions to write a custom wrapper provides a solution for this.A common issue with PInvoke and COM interoperability is that of conflicting names. Two scenarios in which they arise have been mentioned: conflicts between names defined in native header files and assemblies in the same application; and conflicts arising from macro expansions by the preprocessor. Some techniques were given that can prevent these conflicts from occurring.