C++ gurus and learners, we program ourselves :P all work is CC licensed

Sunday, November 24

Moving Text - SCreen Saver in C++

Moving Text - SCreen Saver in C++ Although it is exam time but i just can't help myself from compiler;; below is just code, nothing much to explain; just copy past and run it is compatible with visual studio as no graphic thing is used; enjoy #include<iostream> #include<windows.h> HANDLE...

Saturday, November 23

Hollow Square & Hollow diamond & Hollow Triangle

Hollow Square & Hollow diamond & Hollow Triangle It's basically a request from a student as we go further in loops and functions we need to know more tricks and practise more for these things which eventually leads to good programming; Basic...

Friday, November 22

gotoxy() function in c++ by Umair Sajid

21:49 By

gotoxy() function : The gotoxy function is used to to move the cursor to a specified location on the screen. Its Just Something Other then just Sequential Execution .It moves the cursor with respect to x axis and y axis. It is very useful when the...

Tuesday, November 19

Easy Colouring

As promissed here is bit easy technique for those colour commands; Hope you guys understand it : Theme here is to use funcitons to determin command stuff i.e. how much easy would it be if you only have to type  color(r); //red colour here...

Monday, November 18

Play Sound in Your CPP Program

Till now, all of us have coded C++ programs on the black & white console, some know how to color the text on string. Lets go a step ahead and introduce sound being played as your program runs. Interesting, Right?          Yes,...

Bit Level Manipulation and Programming in C++

C++ is a classical language and it allows us to manipulate bits in much better ways. for starter we will learn 2 kind of bit operators namely bit shift operators Left shift operator: << Right shift operator: >> The left shift operator...

Reverse any Integer without strings

It seems now are a stronger community to write generalized programs for FAST NU as well :) I am posting a program below which reverses any number with just 1 while loop. See if it works :P PS please if you copy this or get inspired from this post for...

Sunday, November 17

Loading bar in C++

Since we are high on special effects these days, so below is the code to make a loading bar in C++. #include iostream.h #include conio.h #include windows.h #include dos.h void main() { system("color 0a"); cout<<"\n\n\n\t\t\t\tPlease wait...

Addition of two 2-Dimensional Arrays

Below is the code that I made to add the elements of a 2-D array. The 2-dimensional arrays have been previously discussed, what they are and how to initialize them. http://cppqa.blogspot.com/2013/11/two-dimension-pointers-c.html For those (like me)...

Saturday, November 16

Recursive functions

19:30 By

Recursive functions Recursive functions are way much difficult then simple functions in a function you place set of commands in a bracket and use it as many time as u want in recursive functions you make such a function which with the help of...

Colour Coding in C++

15:37 By

The first time i saw colour in c++ was amazing experience because just black  and white stuff is more like old school comparing to modern software and  technology. It was hard to find well defined code and definition for colours in...

Ascii Art with C++

While posts on shaskaas are going on let me share another tweak with you. As a trademark thingy you can insert your name with ascii art in beginning of your program and this will always impress your teachers. I used star wars theme always for my assignments...

Friday, November 15

Program that converts ASCII number to character and vice versa By Umair Sajid

12:14 By

This Program can also be done using if-else structure but switch statement is most appropriate.  #include<iostream>  /* Header Files */ #include<stdlib.h>     #include<conio.h>     using namespace...

Wednesday, November 13

Two Dimension Pointers C++

Pointers are very useful construct of C++ programming language and what is more useful is 2d pointers. The pointers are special variables pointing to a memory location or a variable where as an array is a collection of those variables. A 2d pointer...

Tuesday, November 12

Arrays in C++

01:36 By

Hey Guys. This blog is related to a datatype in c++ that you'll find enormously helpful in your future assignments and semester projects. So, to answer the very first question : "What is an Array ?" Formally, An array is a series of elements of the...

Monday, November 11

Diamond Printing Problem from Uxama Ahmad

20:31 By

The problem was diamond did not print odd rows with required spaces and stars. #include <iostream> using namespace std; int main() { int num,i=1,j=1,k=1,space,star; cout<<"Enter odd number of rows: "; cin>>num; if(num%2==0) ...

Sunday, November 10

Function Pointers : the power of C

14:59 By

Function pointers are a very powerful yet misunderstood aspect off programming languages. A function pointer is simply a points to the address of a function in memory instead of pointing to a data variable like a regular pointer.When dereferenced,...

Functions Continued (Functions Input)

02:51 By

Input in functions : type of input We can use functions by 2 methods of input: input as passing arguments by values [Part 1;] input as passing arguments by reference [Part 2;] Part 1; using function : passing arguments by value Problem 1; scope...

Saturday, November 9

Factorial Using Recursive Function

20:56 By

#include <iostream> #include <conio.h> using namespace std; int Factorial(int number) { if (number <2) { return 1; } else { return (number * Factorial(number - 1)); } } void main() { int num; cout << "Enter Number:...

Friday, November 8

Macros In C++ By Umair Sajid

Macros In C++ By Umair Sajid Macros : are pre-processor directives Just As                                 #include<stdio.h>            ...

Increment Decrement Operators

C++ has a great feature of increment and decrement operators. increment means to increase value and decrement means to decrease value. e.g. int apples = 10 ; apples = apples + 1 ;     //increments by 1 apples = apples - 1 ;    ...