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

I have a few questions to be patched up can anybody get these to me ?

What is the output of printf("%d")
What will happen if I say delete this
Difference between "vector" and "array"?
How to write a program such that it will delete itself after exectution?
Can we generate a C++ source code from the binary file?
What are inline functions?
Details about profiling?
Actually these questions were put to students by potential recruiters
Can ANYBODY help me on these
:confused:

prabhu_kar
Newbie Poster
4 posts since May 2004
Reputation Points: 7
Solved Threads: 0
 

Here are some of the answers:

What is the output of printf("%d")


It will output some junk signed integer value because you never told it which signed integer to output.Difference between "vector" and "array"?
A vector is a STL container that has the same functionality as an array, but you check the validity of an index using .at() and you can get the length with .size(). You can also use STL iterators to potentially convert a vector into a different STL container.Can we generate a C++ source code from the binary file?
Sounds hard, if not impossible.What are inline functions?
Functions that the compiler knows to optimize. I think most compiler usually figure out what to inline by themselves these days.Details about profiling?
I use valgrind's cachegrind. Works really well/easily.

daviddoria
Posting Virtuoso
1,996 posts since Feb 2008
Reputation Points: 437
Solved Threads: 204
 

What are inline functions?

Functions that the compiler knows to optimize. I think most compiler usually figure out what to inline by themselves these days.

i would like to append a little more information .
first of this terminology is very much used for functions in classes .
if a particular function is defined inside the class itself it becomes inline .
that is usually if a function is defined and called for the compiler navigates to the part where its defined and then executes the instruction . but if its an inline function the code which define the function as a whole is taken in , rather than navigating to it.
thus by speeding up the execution .

Note : inline functions have to be smaller (lesser lines of code) .its prudent not to make huge functions inline .

rahul8590
Posting Whiz
351 posts since Mar 2009
Reputation Points: 92
Solved Threads: 20
 

I would like to add something to the description of 'inline' functions:
-> The compiler is always replacing an inline function call with all the instructions in the function ...
-> That's why it's recommended to keep the number of lines in an inline function as short as possible ...

tux4life
Nearly a Posting Maven
2,350 posts since Feb 2009
Reputation Points: 2,134
Solved Threads: 243
 

Did you already notice that this is a 4-year old thread?
So, please stop posting here !

tux4life
Nearly a Posting Maven
2,350 posts since Feb 2009
Reputation Points: 2,134
Solved Threads: 243
 

I thought threads were closed if they were not supposed to be posted in any more? I thought I was helping by posting a solution so that the thread could be closed.

daviddoria
Posting Virtuoso
1,996 posts since Feb 2008
Reputation Points: 437
Solved Threads: 204
 

We only close threads when it violates one or more of the DaniWeb rules. Its perfectly acceptable to post in old threads as long as the new posts are on-topic and contain relevant information.

Ancient Dragon
Retired & Loving It
Team Colleague
30,046 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,342
 
We only close threads when it violates one or more of the DaniWeb rules. Its perfectly acceptable to post in old threads as long as the new posts are on-topic and contain relevant information.

OK, I didn't know, thank you for the info !

tux4life
Nearly a Posting Maven
2,350 posts since Feb 2009
Reputation Points: 2,134
Solved Threads: 243
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You