943,813 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 2873
  • C++ RSS
May 11th, 2004
1

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

Expand Post »
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
Similar Threads
Reputation Points: 7
Solved Threads: 0
Newbie Poster
prabhu_kar is offline Offline
4 posts
since May 2004
Apr 4th, 2009
1

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

Here are some of the answers:

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

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

Quote ...
Can we generate a C++ source code from the binary file?
Sounds hard, if not impossible.

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

Quote ...
Details about profiling?
I use valgrind's cachegrind. Works really well/easily.
Featured Poster
Reputation Points: 437
Solved Threads: 204
Posting Virtuoso
daviddoria is offline Offline
1,968 posts
since Feb 2008
Apr 5th, 2009
0

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

Quote ...
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 .
Reputation Points: 92
Solved Threads: 20
Posting Whiz
rahul8590 is offline Offline
351 posts
since Mar 2009
Apr 5th, 2009
0

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

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 ...
Reputation Points: 2125
Solved Threads: 243
Postaholic
tux4life is offline Offline
2,105 posts
since Feb 2009
Apr 5th, 2009
0

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

Did you already notice that this is a 4-year old thread?
So, please stop posting here !
Reputation Points: 2125
Solved Threads: 243
Postaholic
tux4life is offline Offline
2,105 posts
since Feb 2009
Apr 5th, 2009
0

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

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.
Featured Poster
Reputation Points: 437
Solved Threads: 204
Posting Virtuoso
daviddoria is offline Offline
1,968 posts
since Feb 2008
Apr 5th, 2009
0

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

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.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,950 posts
since Aug 2005
Apr 5th, 2009
0

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

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 !
Reputation Points: 2125
Solved Threads: 243
Postaholic
tux4life is offline Offline
2,105 posts
since Feb 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Get memory usage
Next Thread in C++ Forum Timeline: C++ Convert Jumble word to Real possible words





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC