Skip to main content

C Plus Plus programming tutorial | Basics of C++

NETWORK TECH WORLD

 C Plus Plus programming tutorial | Basics of C++

This tutorial is about C++ Programming language. I will teach C++ from very basics to advanced level in this post and upcoming posts. Just wait and read all the posts regularly.
This tutorial is mainly about theoretical knowledge but is very important!
Some Definitions :
  •  Bit : It is the smallest unit a computer can understand. it is either 0 or 1. 0 generally means circuit is OFF and 1 means ON.
  • ASCII : All characters on keyboard have a code which is known as ASCII code.
    Range A-Z  ->  65-90
    a-z  ->  97-122
  • Byte : Group of 8 bits. 1 byte means 1 character.
  • Program : It is a step by step instruction which tell what to do and how to do.
  • Object Code : A program which a machine can understand is called Object Program.\
Compiler : 
A program which converts source code[ English like step wise instruction to computer] to object code[language which a machine can understand].
IT executes the entire program at once and hence It is faster.
Interpreter :
A program which converts source code[ English like step wise instruction to computer] to object code[language which a machine can understand]. But the interpreter executes the program line by line and hence it is slower.
Constants : 
Integer Constant :
  • Consist of 0-9
  • Doesn’t includes commas or spaces.
  • Preceded by a + or – sign. + sign is assumed if there isn’t any sign.
Character constants : Any single character enclosed in single quote (‘). Ex :- ‘a’ ,  ’b’ .
Strings : Generally consist of more than one character within double quote (“).
Ex: “comp”, “abcd”.
Difference between String and Character :
Character constant takes 1 byte for storage while string constant takes 2 bytes for storage because in String  a byte is reserved for Null Byte.
Memory representation : 
Character : ‘A’    ==   |A| << stored in one memory cell
String : “A”  ==  |A|\0|  << stored in 2 memory cells with \0 as a NULL byte.
Variables in C++ : These are the tokens that are identified by identified by an identifier and change the value during execution.
Ex : int a=5;
a=a+3;
cout<<a;
Here a is a variable. The initial value of a was 5 but it was then changed to 8 by command a=a+3 .

Comments

Popular posts from this blog

What is network

NETWORK TECH WORLD What is network  A network is a group of devices, such as computers, servers, and printers, that are connected together and able to communicate with each other. Networks can be classified based on their size and scope, such as a local area network (LAN), which is a network that is confined to a small area, such as a single building or campus, or a wide area network (WAN), which is a network that spans a large geographical area, such as a city or a country. Networks can also be classified based on their communication protocols, such as the Internet, which is a global network that uses the Internet Protocol (IP) to connect devices around the world.

Google Tricks

AA few things you might want to try with Google: Hand type the following prefixes and note their utility: link:url Shows other pages with links to that url. related:url same as "what's related" on serps. site:domain restricts search results to the given domain. allinurl: shows only pages with all terms in the url. inurl: like allinurl, but only for the next query word. allintitle: shows only results with terms in title. intitle: similar to allintitle, but only for the next word. "intitle:webmasterworld google" finds only pages with webmasterworld in the title, and google anywhere on the page. cache:url will show the Google version of the passed url. info:url will show a page containing links to related searches, backlinks, and pages containing the url. This is the same as typing the url into the search box. spell: will spell check your query and search for it. stocks: will lookup the search query in a stock index. filetype: will ...

Network Protocols

NETWORK TECH WORLD A network protocol is a set of rules and standards that define how devices on a network should communicate with each other. Network protocols govern everything from the type of cable that is used to connect devices to the way in which data is transmitted between them. There are many different types of network protocols, each of which serves a specific purpose. Some common examples include: TCP (Transmission Control Protocol): This is a connection-oriented protocol that is responsible for breaking up data into packets, transmitting the packets over the network, and reassembling the packets at the destination. TCP is a reliable protocol that ensures that all packets are delivered to their destination. IP (Internet Protocol): This is a connectionless protocol that is responsible for routing packets between devices on a network. IP is an unreliable protocol that does not guarantee that packets will be delivered to their destination. HTTP (Hypertext Transfer Protocol): Th...