VB & vb.net & C + + programming language basics

Source: Internet
Author: User

VB & vb.net & C + + programming language Basics



From the understanding of VB to C #, to the vb.net in the C + + program design, there are some of the same very basic,

These basic data, operations, Process Control, functions, and so on, in this main combination of vb.net the basis of summing up:




First, the data type

This is what vb.net has and what types are in the data.

The main types are:

1. Data type (Numeric)

2, byte type (byte)
3. String type (Sting)
4. Boolean Type (Boolean)
1), Len: Long integer type
2), Trim: No space around the string all removed
3), LTrim: Left space removed
4), RTrim: The right space to remove
5. Date type






The details of these data types in programming languages are mainly for better operation and more efficient operation.



Second, the operation


1, arithmetic (popularly speaking is mathematical operation) +-x/

divide evenly; mod seek remainder; ^ Seek reference number

2, Assignment : &= First and second connection pass first; =; +=;-=;*=;/=; \=;


3. Comparison : TRUE or false result

1), is relative to object, two operations the same object true, otherwise false
2), like in relation to string type,
4. Connect : + and &, where & is to force the operation into a string, in the connection operation.


5, binary:
1), Bitand and;
2), bitnot non-;
3), bitor or;
4), Bitxor XOR or AB are different true otherwise false


6. Logical Operation :
And, or, non-



Three, constants, variables


1, constant : from the literal meaning also know is constant value, the constant value can not be modified after the assignment.

SOURCE General

1), internal or system definition;
2), custom often declared syntax:
[Public/private/protected/friend/protected Friend] Constname [As Type]=exptrsion


2, variable : That is, after the assignment can be re-assigned value, the variable is temporarily stored value.


declaring variables

Before using a non-Variant variable, you must use the Private, public, Dim, or Static statement to change the

The volume is declared as type. For example, the following statement declares an Integer, Double, String, and

Variables of type Currency:




A declaration statement can combine multiple declarations, see the following statement:




Note: If you do not provide a data type, the specified variable is the default type. As noted in the previous example, if the experience of other programming languages makes you feel that all variables in the same declaration statement have the same specified data type (in this case, Integer), the results here may be fresh.




Summary:

Most of these are in the VB contact, in this is only a comparison, and vb.net for a comparative study

and implement some of these codes. Of course this is also the same in C + +, the language base of the computer, as long as it is counted

Computer language, these are generally generic, to the specific code implementation, but also a little attention to the differences.





VB & vb.net & C + + programming language basics

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.