C++, tokenize a string

I need a cpp function (without using boost, obv) that split a string in parts using an other string as token.

Example input:

[code lang=”cpp” autolinks=”false” collapse=”false” firstline=”1″ gutter=”true” htmlscript=”false” light=”false” padlinenumbers=”false” smarttabs=”true” tabsize=”4″ toolbar=”false”]Center: (8.37, 9.86); Radius: 18.13; Point: (17.83, 6.51)[/code]

Continue reading “C++, tokenize a string”

[C++] Coding in human language

An old snippet just for fun.

Write C++ code in human language 🙂


Magic.cpp:

#include"Magic.h"

Dear Computer
Please print "Hello World!" string
Then wait until user pressed a key
Best Regards
Programmer

Magic.h

#include<stdio .h>
#include<conio .h>

#define a )
#define Best ;
#define Computer (void){
#define Dear void main
#define key ;
#define pressed (
#define Please printf
#define Programmer
#define print (
#define Regards }
#define string );
#define Then int
#define until =
#define user getch
#define wait x

Have fun!