1 / 7

Introduction to VC++.NET

Introduction to VC++.NET. #include”stdsfx.h” // includes contents of stdsfx.h into this program file #using <mscorlib.dll> // references prepackaged Microsoft code Using namespace System; // declares the use of namespace System. A simple program. Int _tmain() {

miya
Download Presentation

Introduction to VC++.NET

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to VC++.NET • #include”stdsfx.h” • // includes contents of stdsfx.h into this program file • #using <mscorlib.dll> • // 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*

More Related