C++ Programming - Is static the problem?


#include < iostream >

using namespace std;

static int i;
class x {
int i;
public:
x() { cout << "In HERE" << endl; }
int geti() { return i; }
};




int main()
{
cout << "Inside main() = " << ((x *)(&i+1))->geti() << endl;
*(&i+1) = 17;
cout << "Inside main() = " << ((x *)(&i+1))->geti() << endl;
static x aa;
cout << "Inside f() : " << aa.geti() << endl;
x bb;
}


When we ran this on Intel Platform Linux (gcc 3.4.3 20041212, Red Hat 3.4.3-9.EL4) & Windows (.NET 2003) the results were very surprising (fcoz will be ;) but on Solaris it worked fine.

Could you guess what was the output on Intel Linux and Windows?

Labels:

Posted by - at 9:05 am | 1 comments read on

Excuses ...

Still researching the software with which I can do the video, as I am not having any prof camera I am going to do a screenrecorder kind of video.

Still in a great confussion to make this an complete audio as we have video posted earlier

Just send me the links of software that are suitable for capturing screen and audio, currently i am using iCord.

Post in your comments!!
Posted by - at 12:56 am | 0 comments read on

Future ...


A complete discussion on the article by Aleph One. Complete hands-on video this time along with SOUND (for deaf ;)

Feel free to post comments, your input are valuable!!!!!!
Posted by - at 10:21 pm | 0 comments read on

C Programming - ShellCode Writing Part 2 (NO AUDIO)


Shellcode writing with null byte stripped!!!

Download - Video File

Labels:

Posted by - at 11:03 pm | 0 comments read on

C Programming - Shellcode Writing Part 1 (NO AUDIO)



ShellCode writing (without trimming null).

Reference: Smashing The Stack For Fun And Profit

Download - Video File

Labels:

Posted by - at 11:01 pm | 1 comments read on

C Programming - Find a Linked List is cyclic or not (Vintage Method)

Two pointer method:

Keep two pointers. One at element 1 and the next at element 3.
See if they are equal; if not, move P1 by one and P2 by two. Check and continue. If P1 or P2 is null, there is no loop. If there is one, it will definitely be detected. One pointer will eventually catch up with the other (i.e., have the same value), though it might take several traversals of the cycle to do it.

Labels:

Posted by - at 2:07 am | 0 comments read on

C Programming - Skip Video!!!! NO AUDIO

Seeing is believing!!!

Check this previous post for more details

Download - Video File

Labels:

Posted by - at 1:35 am | 0 comments read on

Archives

  • May 2011
  • February 2009
  • December 2008
  • November 2008
  • October 2008
  • August 2008
  • April 2008
  • December 2007
  • November 2007
  • January 2007
  • December 2006
  • October 2006
  • September 2006
  • June 2006
  • May 2006
  • April 2006
  • March 2006
  • February 2006
  • January 2006
  • December 2005
  • November 2005
  • October 2005

Links