Vikas Yadav Visual C++ Trainer

Ekam – A smart way to put next step…

Some common rules for writing C program

Remember Some common rules for writing C program

  • Use all commands or statements in lower or small case.
  • After completion of a statement excluding main() or loops must insert ; (semicolon) as a statement terminator.
  • Don’t use/declare identifier or variable name same as statement name suppose int include; this is a wrong statement because include has a special meaning in the language.
  • Header Files or Preprocessor Directives contains references or links of library functions. That is built-in in the C language.

Suppose if you want to use a function clrscr() ; in the main function so must be declared on top # include other wise you could have an prototype error.

Some header files are as follows

  • Stdio.h
  • Conio.h
  • Dos.h
  • String.h
  • Stdlib.h

And many more header files are available in C…

void main(void)
Every C programs consists of one or more functions. No matter how many
functions there are in a C program , main is the one to which control is passed
from the operating system when the program is run ; it is the first function
executed. The word “void” preceding “main” specifies that the function main()
will not return a value. The second “void,” in parenthesis , specifies that the
function takes no arguments.
printf()
printf() is built-in function we can display with printf() any message, variable
value on screen/file/printer.
In printf() we can use many escape sequences and format specifies.

Escape sequences are special notations through which we can display our data
Variety of ways:

Some escape sequences and their functions are as follows:
Escape Sequence    Description                                                   Example

\n                        Perform line feed & Carriage return operation       printf(“A\nB”);

\t                        Prints a tab sequence on screen                          printf (“A\tb”);

\’                         Prints a single quote character on screen          printf (“\’a\’”);

\”                         Prints a double quote character on Screen                printf (“\”a\”");

\r                         Perform carriage return operation                         printf (“a\rb”)

\b                         Remove one character from left                          printf (“a\bHi!” );

September 12, 2009 Posted by JEFFREY MOORE | C Language | , , , | No Comments Yet

C-LANGUAGE NOTES

Some words about Computer Programming languages

Naturally a language is the source of communication between two persons, and also between person to machine like computer. The languages we can use to communicate with the computer are known as Computer programming languages.

Generally there are two major types of languages are available are as follows:

1. Low level languages

2. The set of commands available in low level is complex and not easy to understandable. In this category ” Assembly ” and ” machine codes ” are available. Assembly programs are faster than other high-level language programs.

3. High level languages

• The set of commands available in high level language is very simple and easy to understandable.

High level languages are further divided into two major categories.

1. Procedure Oriented language

2. In this category we are able to create our project or programs using procedural approach means in this type we can able to divide our big project/program into small subroutines or procedures. After making procedures we can able to call a ‘procedure’ one or more places.

The lists of procedural languages are as follows:

C language

C++ (Object Oriented)

Java (Objected Oriented)

Smalltalk (Objected Oriented)

Pascal language

3. Non-Procedural Languages: This category also known as ‘Problem Oriented languages’. In this type of languages we can able to make program only at specific range like database. The followings are the examples of Non procedural languages

1. SQL (Structured Query Language)

2. SNOBOL (String processor)

September 12, 2009 Posted by JEFFREY MOORE | C Language | , , , , | No Comments Yet

Frequently asked Questions (FAQ) about C++

Q. What is C++?
A: C++ is programming language with follows object oriented way of developing software. Object oriented software development means achieving the purpose/goals of a software by defining and designing, creating, manipulating, relating, and distroying objects. C++ is programming language is derived from C, but C++ has many addtional features not available in C. C++ broadly can be said as C++ = C plus object oriented features plus templates.

Q: What are Objects?
A. An object can be defined as a unit holding data and the capabilities to manipulate data.

Q. Is the knowledge of C Programming necessary to learn C++?
A: No, the knowledge of C programming is NOT NECESSARY to learn. Infact, our exeperiece has shown that it is better if student does not know C while taking up C++ training. There are certain concepts which are directly opposite in C and C++.

Q. Why C++ is so popular?
A: In simple language, C++ is popular becuase of its capabilities to create fast running, low memory occupying, low CPU time occupying applications in minimal time requirements. After assembly lanugage, C++ is the most efficient progrmaming language for almost all the Operating Systems in the World. C++ offers object oriented capabilities and pointer manipulation capabilities which together enables developer to create great applications quickly.

Q. What are the pre-requisite to learn C++?
A: All you need to learn C++ is good logical and analytical mind, good imagination and reasoning capabilities. It is NOT essential or compulsory to have a science or engineering background. We have seen some of the best C++ developers from non-science or non engineering background.

Q. Is C++ difficult to learn?
A: YES and NO. Yes, because it is comparatively difficult when compared to other programming languages like Java or Pascal or other popular development tools like Visual Basic and, No because it is not difficult in absolute terms. The primary reason for C++ being difficult to learn is students do not visualize memory. If the students visualize memory, C++ will be the most enjoyable and fun to learn and code in.

Q. What is Object Oriented Programming?
A: Object Oriented Programming is the capabilities of the respective programming language to create, manipulate, distroy and operate on Objects. Objects can be defined as Data and the capabilities to manipuate data put together in one single unit. C++ offers rich object oeriented features and capabilities. See Object Oriented Programming in C++ for course curriculum.

Q. How is C++ different from Java?
A: Java is derived from C++ and offers many features of C++ and does not offer some features of C++. Java is way simpler compared to C++ and offers less object oriented features compared to C++. Overall, there are many concpets which are common and and many are not.

Q. How long does it take to learn C++?
A: Varies greatly on many factors. In general, the fundamental C++ training should take between 50 to 70 hours of instructions and about same number of hours for self practice.

Q. What software do I need to start working with C++?
A: Turbo C++ is the best software for the beginers to start working with C++. It is simple to use, offers excellent help, good features overall.

Q. What is Visual C++ (VC++)?
A: Visual C++ is the C++ development and published by Microsoft Corporation. It is meant for creating applications for Windows family of Operating Systems. VC++ is NOT A PROGRAMMING language. Programming in VC++, means actually programming in C++ with ready-to-use classes library available with VC++.

March 27, 2008 Posted by JEFFREY MOORE | VC++ Training | , , , , , | No Comments Yet