Post your best C++ jokes, poems, stories, etc.

Pages: 123456
Lol :P
__stdcall and __cdecl are not standard C++ - neither long long but suppose C++0x -

1
2
3
 
export template < typename Type_Name > inline volatile static const unsigned long long int ***function();
 
Last edited on
needs moar templates. moar levels of indirection.
Last edited on
 
export template < volatile const unsigned long long int value > inline volatile static const unsigned long long int * const & function(void);
1
2
// added 'auto'
export template < auto volatile const unsigned long long int value > inline volatile static const unsigned long long int * const & function(void);
My dev-c++ don't even highlight export as a keyword
added 'auto'

Damn, I knew I forgot something.
My dev-c++ don't even highlight export as a keyword
90% of the compilers don't support it http://en.wikipedia.org/wiki/C%2B%2B#Compatibility
"It is said that the world's best C++ programmer can write a program efficient enough to execute an infinite loop within 17 seconds..."
1
2
//changed auto to register
export template < register volatile const unsigned long long int value > inline volatile static const unsigned long long int * const & function(void);
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>
#include <algorithm>
#include <string>
#include <allegro>
using namespace std;
int main()
{

cout << "hOW are you are play wow i dont love you no you me \n";

return 0;

}
wtf?
I'm not sure, I think it's the idea that new programmers always seem to include ridiculous files they don't need.

I do it sometimes :)
true story based on post on one of the polish programmers forums

quote:

Does anyone know how to solve the problem with large files?
I have built a mp3 database. Here are the fields inside my class body:
1
2
3
4
5
6
7
8
9
10
11
12
13
int ile;
[code]char autor[100000][40];
char tytul[100000][40];
char album[100000][40];
char info[100000][1000];
char nazwapliku[100000][200];
char nazwa[100000][100];
int priorytet[100000];
char kategoria[100000][20];
char podkategoria[100000][20];
int fade[100000];
bool zablokowane[100000];
int id[100000];


Of course every field is created dynamically
and now when I'm trying to store it an error occures: Accessviolation. Size of my file is only 1MB and field char autor[100000][40]; ca. 4MB

I have tried to save by turn only those records i used, but the same error occured when trying to assign it to the structure...

Here's my storing function:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
fstream plik;
plik.open("osoba.bin", ios::out | ios::binary);
plik.write((char*)this,sizeof(int)
+ sizeof(char)*40*100000
+ sizeof(char)*40*100000
+ sizeof(char)*40*100000
+ sizeof(char)*1000*100000
+ sizeof(char)*200*100000
+ sizeof(char)*100*100000
+ sizeof(char)*40*100000
+ sizeof(int)*100000
+ sizeof(char)*20*100000
+ sizeof(char)*20*100000
+ sizeof(int)*100000
+ sizeof(bool)*100000
+ sizeof(int)*100000
+2 );
plik.close();


char tytul[100000][40];
Am I wrong, or this is actually an array of 40 titles of 100,000 characters each, rather than an array of 100,000 titles of 40 characters each?
Return 0 (283)
This is joke:).You were surprised :D
I just thought of something:

I'll write a new programming language. It'll be called ++C, so it'll be faster than C++!
Don't you mean: Possibly faster, but never slower...

:-D
No, I will use f(ast)printf and f(ast)stream.

Also, the text will be sent via HTTP, the hyper means the text is reallz fast.

Here's some example code:
1
2
3
4
5
6
7
8
<?++c
include(htOut)

$_main(int speed = std::veryFast):
   plik.write(sizeof(long long)
    fprintf('hello');
    db world = 'world'
    offset world

Does this count?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//Illusion.cpp
/****************************************************************************/
/*  Run to see a rather subtle illusion                                     */
/*  Move your head to and fro from the output screen to see a strong wave   */
/*  You might even see small black dots that actually aren't present        */
/*  (This happens when you are at some distance from the screen)            */
/****************************************************************************/
//Made by harryp

#include<iostream.h>
#include<conio.h>
 void main()
 {
     clrscr();
     int size=24,cnt,bg,row,col;
     cnt=size-1;
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     for(row=1;row<=(2*size-1);row++)
     {
	if(row<=size)                          
	{
		for(bg=cnt+16;bg>0;bg--)
		{	cout<<"\\";     }
		for(col=1;col<=(2*row-1);col++)
		{	cout<<"/";      }
		for(bg=cnt+16;bg>0;bg--)
		{	cout<<"\\";     }
		cout<<endl;
		cnt--;
	}
	//--------------------------------------------------------------------
	else if(row>size)                   
	{
		for(bg=-cnt+16;bg>0;bg--)     
		{	cout<<"\\";     }     
		for(col=1;col<=(2*size-1+2*cnt);col++)
		{	cout<<"/";      }
		for(bg=-cnt+16;bg>0;bg--)
		{	cout<<"\\";     }
		cout<<endl;
		cnt--;
	}
     }
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     getch();
 }
//END OF PROGRAM

Last edited on
Pages: 123456