Skip to content

lakshyajain1508/CPP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

C++ is a powerful and versatile programming language.

What is C++?

C++ is a general-purpose programming language developed by Bjarne Stroustrup at Bell Labs in 1979. It is an extension of the C programming language with additional features like classes and objects, making it an object-oriented programming (OOP) language. C++ is widely used for developing system/software infrastructure, game development, embedded systems, and more.

Why Learn C++?

  1. Versatility: C++ is a versatile language used in various domains, from system programming to game development.
  2. Performance: It allows low-level manipulation, making it efficient and suitable for performance-critical applications.
  3. Object-Oriented: C++ supports object-oriented programming, making code organization and reuse more straightforward.
  4. Community and Resources: With a vast community and numerous online resources, learning and problem-solving become more accessible.

Installation

https://sourceforge.net/projects/mingw/

Setting Up Your Development Environment

Before diving into coding, let's set up your development environment. Follow these steps:

  1. Install a C++ Compiler: Choose a C++ compiler suitable for your platform. Popular choices include GCC for Linux, MinGW for Windows, and Xcode for macOS.

  2. Choose an Integrated Development Environment (IDE): Select an IDE that supports C++. Options like Visual Studio, Code::Blocks, and Eclipse are popular among C++ developers.

  3. Create Your First C++ Program: Write a simple "Hello, World!" program to ensure your environment is set up correctly.

#include <iostream>

int main() {
    std::cout << "Hello, World!" << std::endl;
    return 0;
}

Basic C++ Concepts

1. Variables and Data Types

In C++, you declare variables to store data. Each variable has a data type, such as int for integers, double for floating-point numbers, and char for characters.

int age = 25;
double pi = 3.14;
char grade = 'A';

2. Control Flow

C++ supports traditional control flow statements like if, else, for, and while. These help in decision-making and looping.

if (age >= 18) {
    std::cout << "You are eligible to vote." << std::endl;
} else {
    std::cout << "You are not eligible to vote." << std::endl;
}

3. Functions

Functions allow you to encapsulate a set of instructions for reuse. Here's a simple function to add two numbers:

int add(int a, int b) {
    return a + b;
}

About

My C++ Concepts, small projects and assignments are there

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages