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

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2004
Posts: 4
Reputation: prabhu_kar is an unknown quantity at this point 
Solved Threads: 0
prabhu_kar prabhu_kar is offline Offline
Newbie Poster

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

 
1
  #1
May 11th, 2004
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 628
Reputation: daviddoria is a jewel in the rough daviddoria is a jewel in the rough daviddoria is a jewel in the rough 
Solved Threads: 46
daviddoria daviddoria is offline Offline
Practically a Master Poster

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

 
1
  #2
Apr 4th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 210
Reputation: rahul8590 is on a distinguished road 
Solved Threads: 10
rahul8590's Avatar
rahul8590 rahul8590 is offline Offline
Posting Whiz in Training

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

 
0
  #3
Apr 5th, 2009
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 .
<?php
$data = $_POST['data'];
if(empty($data)) {
echo "byte me" ; }
?>
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 1,968
Reputation: tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute 
Solved Threads: 214
tux4life's Avatar
tux4life tux4life is offline Offline
Posting Virtuoso

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

 
0
  #4
Apr 5th, 2009
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 ...
"Never argue with idiots, they just drag you down to their level and then beat you with experience."
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 1,968
Reputation: tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute 
Solved Threads: 214
tux4life's Avatar
tux4life tux4life is offline Offline
Posting Virtuoso

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

 
0
  #5
Apr 5th, 2009
Did you already notice that this is a 4-year old thread?
So, please stop posting here !
"Never argue with idiots, they just drag you down to their level and then beat you with experience."
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 628
Reputation: daviddoria is a jewel in the rough daviddoria is a jewel in the rough daviddoria is a jewel in the rough 
Solved Threads: 46
daviddoria daviddoria is offline Offline
Practically a Master Poster

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

 
0
  #6
Apr 5th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,346
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1460
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

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

 
0
  #7
Apr 5th, 2009
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.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 1,968
Reputation: tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute 
Solved Threads: 214
tux4life's Avatar
tux4life tux4life is offline Offline
Posting Virtuoso

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

 
0
  #8
Apr 5th, 2009
Originally Posted by Ancient Dragon View Post
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 !
"Never argue with idiots, they just drag you down to their level and then beat you with experience."
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC