CBSE 2026 results are out, Mukul scored a perfect 100/100 in Computer ScienceSee all toppers →

KwickCards C and C++

C and C++: 10 revision cards

Every card below is written out in full underneath its picture, so you can read it, search it and copy from it. Free, no sign-up.

C and C++

C and C++

I learned new things, and rather than mugging up the code, I learned to develop logic.

C and C++ teach you how a computer really thinks.

Loops, arrays, pointers, functions and object-oriented C++, the foundations behind almost every other language. Whether you are preparing for NIOS Computer Science 330, GSEB, or simply want strong programming skills, Kajal Ma'am teaches live, step by step, with plenty of practice.

Small batches or one-to-one, fully online.

"I learned new things, and rather than mugging up the code, I learned to develop logic.", Jay Jariwala, Kwickprep student.

Pointer

C PROGRAMMING

Pointer
A variable that stores an address. & gets the address; * reaches the value stored there.

Exampleint *p = &a;

Pointers feel scary until you see what they really do.

With int a = 10; int *p = &a; p stores the address of a. *p means "the value at that address", so *p = *p + 5 changes a itself from 10 to 15. Printing a and *p then shows 15 15.

Think of a pointer as a note with a house address: follow it with *, and you reach the real house.

Read pointer expressions carefully

C · POINTER ARITHMETIC

Read pointer expressions carefully

  • arr means &arr[0]
  • *(p + 2): 2 ahead
  • *p + 10: adds value
  • p++: next element

An array name is the address of its first element, and that makes pointer arithmetic work.

Take int arr[] = {2, 4, 6, 8}; int *p = arr; so p points to arr[0]. *(p + 2) is arr[2], which is 6. After p++, p points to arr[1], so *p is 4, and *p + 10 is 14.

Note the difference: *(p + 1) moves to the next element, while *p + 1 adds 1 to the current value. Brackets change everything in pointer expressions.

Your first C++ class

C++ · CLASSES

Your first C++ class

  • class Rect
  • private: l, b
  • Rect(6, 4) sets them
  • area() returns l * b

Classes and objects are the heart of C++.

Rect has two private data members, l and b. The constructor sets them when an object is created as Rect r(6, 4), and the public member function area() returns 6 × 4 = 24.

Members of a class are private by default, and that is data hiding in action.

Reference (&)

C++ · FUNCTIONS

Reference (&)
Another name for the same variable. Changes inside the function change the original.

Examplevoid exchange(int &x, int &y)

Why does a function with & parameters actually swap the values?

In void exchange(int &x, int &y), x and y are references, other names for the variables passed in. Swap them inside and the originals change: a = 3, b = 9 become 9 and 3.

Without the &, the function would receive copies (call by value), and a and b would still hold 3 and 9. References are one of the simple but powerful features C++ adds over C.

sizeof(char) in C, always

C · DATA TYPES

1 byte sizeof(char) in C, always

A Java char takes 2 bytes

A quick C question for NIOS and GSEB students.

sizeof(char) is exactly 1, every time.

In C, sizeof(char) is always 1 by definition, one byte. The sizes of int, float and others can depend on the compiler and system, but char is fixed at 1.

Compare with Java, where a char takes 2 bytes because it stores Unicode characters.

What does :: do here?

C++ · OOP

One symbol, many uses

What does :: do here?

class Rect {
  public: void show();
};
void Rect::show() {
  std::cout << "Rect";
}

One symbol, many uses in C++. Do you know it?

Answer: :: is the scope resolution operator.

The scope resolution operator is used to define a member function outside its class, as in void Rect::show(), to access a global variable hidden by a local one, and with namespaces, as in std::cout.

The dot (.) accesses members through an object, and -> accesses members through a pointer.

Array index is pointer maths

C · POINTERS

Array index is pointer maths

  • 10
  • 20
  • 30
  • 40

arr[i] means the same as *(arr + i)

Pointers are where many C learners get stuck. Start here.

A pointer is simply a variable that stores an address. Use & to get an address and * to reach the value stored there.

Because an array name gives the address of its first element, arr[i] and *(arr + i) mean the same thing.

An uninitialised pointer points to an unknown location, so set it to a valid address or NULL before using it.

The cells on the image hold sample values.

What C++ builds on C

C++ · OOP

What C++ builds on C

  • Virtual functions
  • Inheritance
  • Overloading
  • Classes and objects
  • C foundation

Already know C? Here is what changes when you move to C++.

C++ keeps C's syntax for loops, arrays and pointers, and adds object-oriented programming on top. Classes bundle data with functions, constructors initialise objects, and inheritance lets you reuse code.

Practical features like references and the iostream library make programs shorter and safer.

It is a strong next step for NIOS and programming-course students.

C vs C++

C · C++

C

  • Procedural
  • printf() / scanf()
  • No classes

C++

  • Object-oriented
  • cin / cout
  • Classes, inheritance

Should you learn C or C++? First, understand how they differ.

C focuses on functions and step-by-step procedures, which builds strong logic and memory concepts like pointers. C++ builds on C and adds object-oriented features, making large programs easier to organise.

Most C programs can be compiled as C++ with small changes, so learning C first gives you a head start.

Kajal Ma'am teaches both live online, from basics to OOP.

Want this taught, not just read? Kajal Ma'am teaches these live, in small batches.
Book a free demo class

Written by Kajal Mehta (Kajal Ma'am), MCA, teaching computer subjects since 2004. All KwickCards

Want a plan that actually fits your board dates?

Ask Kajal Ma'am directly, 20+ years teaching computer science. Free demo class first, no payment.

Talk to Kajal Ma'am on WhatsApp

Or see the Class 12 Computer Science course →

Studying outside India?

We coach CBSE, IGCSE & international students across the globe, one-to-one, in your local time zone.

Visit International →