hi , i am java developer and i just finished learning c++.
Now here are my questions :

1) why is auto-ptr useful .

You use pointers if you have as goal to maintain variables when they are out of scope,
why use auto-ptr that when they are out of scope they get destroyed. Doesn’t this
destroy the whole concept of pointers ?
This is what a normal variable does, right ? So why use auto-ptr instead of a normal variable.

2) Choosing how to represent an number :
-------------------------------------

I want to represent numbers in such a way like java.
a) integers store 32 bit no matter the compiler / architecture.
Long store 64 bit no matter the compiler / architecture.

b) numbers are stored with the same endianess e.g in java all are stored in big-endian.

c) Why I want this ? because later if I use networking I want not to have problems like
“What if in one machine these variable is stored as a 32 bit and in another as a 64
Bit”.
Am I missing something ? lets handle endianess problem by assuming that you convert all to big endian when you sent them to other computers. But how do you handle the fact that each number will have different number of bits. They will cause overflow and when sending a packet you wont be able to assume what the size is (maybe c++ has a function that tells). So how will you read it correctly from someone that you don’t know his architecture.

d) I have heard rumors that float is not portable especial if you use them in networks ?
why and how do you handle them ?

e) I want also to do something extra. Assume that at start I represent a number as int, maybe later in the programming phase, I decide that int is not worth for me, and I want to change it to long without writing an extra lines of code. Do you use templates ? or typedefs ? what is the differences / advantages of each approach ? Will the program became slower because of the use of typedefs ? or they are always inlined by the compiler?

4) can you in c++ choose an option that will allow you to inline all code (maybe a compiling flag ?), in java you could do this by putting final keyword in front of a class. Yes I know that putting code in .h will inline that method, but is there are easier way ? lets say that I want to inline the program only when I release it to the public, but when I run the program for my self, I want it to be normal (so its more readable and i have reduced compiling costs).

5) anyone know what makes c++ a not portable language for other operating systems (linux)? I don’t care about compiler incompabilities assuming that all will use visual studio 2008 but i care about operating systems. Any links ? Why were the creators of c++ so shortsighted ? they could always make all functions portable by checking the operating system and responding in the appropreate way .

6) shared_ptr: does it work exactly like the way java works?
e.g you can use it safely without ever deleting it (of course, if you are not careful you may have memory leak e.g if the reference counter never goes to 0).

thanks, i am looking forward to receiving your answers.