Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to VC++.NET #include”stdsfx.h” // includes contents of stdsfx.h into this program file #using // references prepackaged Microsoft code Using.

Similar presentations


Presentation on theme: "Introduction to VC++.NET #include”stdsfx.h” // includes contents of stdsfx.h into this program file #using // references prepackaged Microsoft code Using."— Presentation transcript:

1 Introduction to VC++.NET #include”stdsfx.h” // includes contents of stdsfx.h into this program file #using // references prepackaged Microsoft code Using namespace System; // declares the use of namespace System

2 A simple program Int _tmain() { Console::WriteLine(S”Welcome”); // display a string return 0 }// end of _tmain

3 namespace A namespace groups various MC++ features into related categories. The namespace that are defined int the.NET Framework contain preexisting code known as the.NET Framework Class Library. A example of one of the features in namespace System is class Console

4 Console class The Console class enables programs to output information to the computer’s standard output. Class Console provides methods, such as method WriteLine, that allow MC++ program to display strings and other types of information in the windows console window

5 S The S prefix indicates that the string that follows is a string-literal in the Managed Extensions for C++ Write(S”..”); WriteLine(S” …”); ReadLine(); read a string from keyboard

6 Another example int _tmain() { String *Firstnum; String *Secondnum; int num1, num2, sum; Console::Write(S”Enter first integer”); Firstnum = Console::ReadLine(); Console::Write(S”Enter second integer”); Secondnum=Console::ReadLine(); num1 = Int32::Parse(Firstnum); num2 = Int32::Parse(Secondnum); sum = num1+num2; Console::WriteLine(S”\nThe sum is {0}.”, sum.ToString()); return 0; }

7 FCL Structure/class name Int16 16 bit signed integer short Int32 32-bit signed integer int Int64 64-bit integer __int64 Single 32-bit float Double 64-bit double Boolean boolean value bool Char Unicode(16-bit)character String string of unicode characters String*


Download ppt "Introduction to VC++.NET #include”stdsfx.h” // includes contents of stdsfx.h into this program file #using // references prepackaged Microsoft code Using."

Similar presentations


Ads by Google