Gopi Krishna Komanduri <[EMAIL PROTECTED]> wrote:
>         I want to know  3 things.

The wrong things by the looks of it. Neither C nor C++ are
well suited to learning by experimentation. Get yourself
a good book and only program what you know. [It's a practice
I still try to employ as much as possible today! It has
certainly proven beneficial to me.]

>   1)In C++ , when we try to delete a this pointer , what
> will happen?

http://www.parashift.com/c++-faq-lite/freestore-mgmt.html

>   2)why SIZEOF is an operator not a function?

Tell us why it should be a function. Tell us how a function
can take a type as an argument.

> The syntax resembels a function...

  size_t sz = sizeof x;

Doesn't look like a function to me.

>   3) Is there any way to find 2 power x when we
> are provide x...

Yes, there's a function in <math.h> that does that.

> I tried with shift operators but unable to find out.

Ah, I see where you went wrong. You only need one shift
operator for limited integral powers.

>   4) main()
>      {
>         printf("%d");
>      };
>      In the above , the output I am getting is garbage.

That's because the code is garbage.

It is IMO a bad reflection on your learning methodology
that you even want to know why this garbage gives garbage
results.

My advice: don't learn to program by guesswork, learn to
program by studying correct forms.

You can let yourself be misguided by curiosity, or you
can drasctically cut the time you take to learn the
language. The choice is yours.

> ...May I know  how compiler is giving  some garbage...

Why study broken code?

-- 
Peter

Reply via email to