Showing posts with label geek fun. Show all posts
Showing posts with label geek fun. Show all posts

Friday, August 10, 2012

Two very annoying mistakes

I am very good at doing silly mistakes in c++ syntax. Here are two of the most disturbing mistakes.
1. Forgetting to put ; after class declaration :
   class mb
   {
int a;
   }

  Error :  "expected unqualified-id at end of input"

2. Forgetting to leave a space after ">" in map declaration.
  map<string,vector<double>> *a;
    Error : ‘>>’ should be ‘> >’ within a nested template argument list
    Correct syntax : map<string,vector<double> > *a;

The second one is more annoying . It made me google many a times :)

Saturday, May 12, 2012

Funny C++ Declarations

I was browsing through GNU website and I found a page full of fun. Here are some examples from that page...


1. struct dumb by[sizeof member];
2. struct by_lightning;
3. short circuit;
4. void if_removed();
5. unsigned check;
6. class dismissed : public annoyance
7. long trousers_with_holes;


For more fun head to source http://www.gnu.org/fun/jokes/declarations.html