Jump to content
darkston3e

Simple C++ challenge

Recommended Posts

Ce ar trebuii sa printeze:

[COLOR="#808080"]#include[/COLOR] [COLOR="#A52A2A"]<stdio.h>[/COLOR]

[COLOR="#0000FF"]char[/COLOR] *c[]=
{
[COLOR="#800000"]"ENTER"[/COLOR],
[COLOR="#800000"]"NEW"[/COLOR],
[COLOR="#800000"]"POINT"[/COLOR],
[COLOR="#800000"]"FIRST"[/COLOR]
};

[COLOR="#0000FF"]char[/COLOR] **cp[]={c+3,c+2,c+1,c};

[COLOR="#0000FF"]char[/COLOR] ***cpp=cp;

[COLOR="#0000FF"]int[/COLOR] main([COLOR="#0000FF"]void[/COLOR])
{
printf("[COLOR="#A52A2A"]%s[/COLOR]",**++cpp);
printf("[COLOR="#A52A2A"]%s[/COLOR] ",*--*++cpp+3);
printf("[COLOR="#A52A2A"]%s[/COLOR]",*cpp[-2]+3);
printf("[COLOR="#A52A2A"]%s\n[/COLOR]",cpp[-1][-1]+1);
[COLOR="#0000FF"]return[/COLOR] 0;
}

Dark.

Link to comment
Share on other sites

Diferenta nu e tare mare, sa zicem asa ca o idee C e cumva mai brut fata de C++. C++ poate fii mult optimizabil, dar pentru maximum de eficienta si performanta este C, difrenta intre ele nu e imensa. Ex. pentru a afisa ceva in C de folosesti de functia printf() din stdio.h, iar in C++ de instructiunea cout din iostream.h.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...