954,487 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

c doubts

Hi to one and all,

this is satya,

I few doubts in c those are, All are linux based,

1) How we can convert physical address to virtual adress and vice-versa,for this any linux system call.

2)How a float will store in binary format.

3)what the use of constant volataile.

satyanarayanam
Newbie Poster
4 posts since May 2007
Reputation Points: 10
Solved Threads: 0
 
1) How we can convert physical address to virtual adress and vice-versa,for this any linux system call.


Not related to C++. It depends on the OS and it's memory mgmt algorithms. Check up http://en.wikipedia.org/wiki/Linux#References , I think you'll find some link that explains how Linux does it.

2)How a float will store in binary format.


No too sure but, one really don't need to bother abt it if you're using standard APIs for reading and writing a float to/from a binary stream.
My guess: Same as it would be represented in logical memory (which would be different for different hardware and types (double, float...).3)what the use of constant volataile.
It tells compiler that don't optimize (by caching it's value) use of this variable all the time as it's value could change at anytime during the execution of the program WITHOUT it's knowledge. So basically wherever it generates code for accessing such a variable it'll make sure that it gets the value from variable's actual memory location.
Always check wikipedia most probably you'll find it there...

thekashyap
Practically a Posting Shark
811 posts since Feb 2007
Reputation Points: 254
Solved Threads: 75
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You