This will work in GCC but not in G++
int main()
{
int new=1;
return 0;
}
There can be many programs of C++ , that cannot be compiled through GCC bcz
C++ is OOP for which G++ is needed.
On Sat, Sep 17, 2011 at 1:50 AM, SAMMM <[email protected]> wrote:
> You can try this also this will work in C++ not in C .
>
> I ) For Register Variable :-
>
> #include<stdio.h>
>
> int main()
> {
> register int c=100;
> printf("%u ",&c);
> return 0;
> }
>
>
>
>
> II ) Function inside a structure :-
>
> #include<stdio.h>
>
> struct Test
> {
> char c;
> void function()
> {
> printf("hi\n");
> }
> };
>
> int main()
> {
> struct Test t;
> t.function();
> return 0;
> }
>
>
> ##################################
>
>
>
> For the opposite Works in C not in C++:-
>
> Compulsory to return an INT in CPP .
>
> #include<stdio.h>
>
> main()
> {
> int c=100;
> printf("%d \n",c);
> return ;
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>
--
Kumar Anurag
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.