Skip to main content

Most Code will now be at my GitHub - AdityaGupta150

Friends... i didn't update this blog for a month. But actually it was the period of time, i LEARNED and DID the most.
The sole purpose of this blog for me, was just to put 'Interesting Observations' i used to get during finding or solving the errors, and some just clicked to try.
Now, that i have actually been trying many languages and design, so most of the new code part will be on GitHub from now on... Thanks for reading... and I WILL keep posting more inferences here (I got dozens in this month due to the projects ;D ). And special thanks to DevHack1.0 team!

GitHub link -> https://github.com/AdityaGupta150

Comments

Popular posts from this blog

Message Scroller (Big and Styled Characters)

/*
    IDEA BY OUR SIR

    Programmer - Aditya Gupta (aka. Techy15)
    Language - C++

    NAMASTE !
*/


//Known Bug : It doesn't scroll if it the length of the bigger string matches the terminal width, for a second or so

/*LEARNT ThINGS :
 * VIM : :%s/foo/bar/g finds and replaces ALL 'foo' with 'bar'
 * A - 65
 * a - 97
 *Observation - Terminal in windowed mode has a heiht of 23 lines, width of 80 characters; and in full screen, has a height of 38 lines, and width of 169 characters [Useful for creating clrscr alternative with newlines] */

#include <iostream>
#include <string>
#include <unistd.h>

#ifdef _WIN32   //Macro defined by MSVC (Microsoft Visual C++) compiler (not g++)
    #include <windows.h>
#elif __linux__
    #include <sys/ioctl.h>
#elif __MINGW32__   //MinGW (g++)
    #include <windows.h>
#elif __CYGWIN__    //CygWin (g++)
    #include <windows.h>
#endif

using namespace std;

//char l[12][8][10]={{"-----…

LudO - The Game

/*
Programmer - Aditya Gupta (Techy15)
Language - C++
Program - LudO - The Game
*/

/* PLANS- Add functionality for name of player */

//IMP NOTE - See all notes, written in this form "//NOTE..."

//NOTE- Mark 'R','G','B','Y' for gotis, ignore doubling for now
//NOTE- Settings will have options: change default game play order(ie RBYG), change/give names to each colour
//NOTE- Add code in case of attacks
//NOTE- Add stops, and ways to show them distinct from others {may require graphics.h}

#include<iostream>

/* #include<fstream>
   To be used in case save & resume to be used*/

#include<cstdio>
#include<cstdlib>
using namespace std;
//Changes on 16th Oct

//Show gotis as R1, R2... and ask user to enter string R1 or whatever


//


// Place within appropriate block ...
    short diethrow(){
    int fl=1; //holds 0 if decnum is 0
    while(fl==0) { char *temp;
        temp=new char; short decnum=0;
    unsigned long location=&…

FUN with the FUNCTIONS in C++

1. To define a function outside the class, there MUST be a prototype inside the class.
For eg.
class Jg{
int num;
public:
Jg(){ num=0; }
};
void Jg::Display() //Error will be here
{ cout<<num;
}
//This Program will give the error "no 'void Jg::Display()' member function declared in class 'Jg'"

2. What if one member function defined twice, once inside class and once outside?
Will give error "[error]redefintion of int Jg::Display()"
And then pointing on the first defintion it will give "[NOTE] int Jg::Display() previously defined here"
PROGRAM - #include<iostream>
using namespace std;
class Jg{
int num;
public:
Jg(){
num=0;
}
Display(){
cout<<"Hello";
}
};
int Jg::Display(){ //ERROR
cout<<num;
}
main(){
Jg J1;
J1.Display();
}

3. What if a member function declared twice inside the class?
Will show error "int Ag::Display() cannot be overloaded"
Program- #include<iostream>
using namespace std;
class Ag{
int n…