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:

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.

commented: Nice explanation ! +1

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 .

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 ...

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

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.

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.

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 !

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.