Question

In: Computer Science

What is the difference between the two statements below? In addition, in what folders (general not...

What is the difference between the two statements below? In addition, in what folders (general not specific) would the below files be located?

#include <string.h>

#include “myHeader.h”

Write an example of a post-test while loop

Describe the difference between pass by pointer (reference) and pass by value? Which one executes faster? Which one takes more memory space? Which one can modify the original data set being passed? (note 4 sub-questions)

Solutions

Expert Solution

(1.) The difference between #include<myHeader.h> and #include "myHeader.h" are as follows:-

#include<myHeader.h> is used for predefined standard header files, where as #include "myHeader.h" is used for used defined header files, #include "myHeader.h" is used for header files in current directory, and the compiler searches the current directory for the header file, where as the #include<myHeader.h> is used for standard directory searches of header files.

(2.) The example of post-test while loop is as follows:-

#include<stdio.h>
int main()
{
   int i=1;
   do
   {
   printf("%d ",i);
   i++;
   }while(i<10);
return 0;
}

Output :- 1 2 3 4 5 6 7 8 9

(3.) The difference between call be value and call by reference is as follows:-

Call by value Call by reference
While calling a function, the copy of variable is passed While calling a function, the address of the variable is passed
Change made in copy of variable will not modify the actual value of variable in outside the function Change made in the variable will also modify the actual value of variable in outside the function
Actual and formal arguments will be located at different memory location Actual and formal arguments will be located at same memory location
Value is passed simply Value is passed through pointers.
It is slower in execution It is faster in execution
It can take more memory space if it used data type of larger size It can take less memory space as the pointer size is always fixed
It can not modify the original data set being passed It can modify the original data set being passed

Related Solutions

What is the difference between illness and disease? In addition, what is the difference between westernized...
What is the difference between illness and disease? In addition, what is the difference between westernized vs non westernized medicine. What are your views on these two types of medicine. Which do you prefer? Do you tend to depend on westernized medicine or does your culture use alternative medicine? Should we consider non westernized medicine when discussing treatment with our patients? Include APA format, title page and work cited page. 2 page response required for full credit
What is the difference between general anesthesia, local anesthesia, and sedation?
What is the difference between general anesthesia, local anesthesia, and sedation?
a. In general is there any difference between R and S, and + and -? between...
a. In general is there any difference between R and S, and + and -? between d- and l-, and + and -? b. Discuss the validity of the following statements: 1. A mixture of (+)- and (--)-carvone can be separated by column chromatography on silica gel using hexanes-acetone as elution. 2. In general, column chromatography on silica gel is run with a series of solvents of increasing polarity. 3. Carvone is more polar than limonene. c. Which compound, limonene...
a. In general is there any difference between R and S, and + and -? between...
a. In general is there any difference between R and S, and + and -? between d- and l-, and + and -? b. Discuss the validity of the following statements:         1. A mixture of (+)- and (--)-carvone can be separated by column chromatography on silica gel using hexanes-acetone as elution.         2. In general, column chromatography on silica gel is run with a series of solvents of increasing polarity.         3. Carvone is more polar than limonene. c....
What is the difference between Addition and Condensation reactions? How does this relate to polymers? Write...
What is the difference between Addition and Condensation reactions? How does this relate to polymers? Write a balanced nuclear equation for the following: When iridium-192 emits a beta particle as it decays Compare and contrast the molecular structure and performance characteristics of LDPE and HDPE. Provide an example of each type of polymer Describe two types of methods that can be used to mold plastic products. Tin (Sn), with a mass number of 126 and an atomic number of 50,...
-What is the difference between a general partner and a limited partner? Give an example of...
-What is the difference between a general partner and a limited partner? Give an example of a situation in which a person would want to be a limited partner.
What is the difference between: acid-base oxidation-reduction nucleophilic substitution elimination electrophilic addition nucleophilic addition electrophilic aromatic...
What is the difference between: acid-base oxidation-reduction nucleophilic substitution elimination electrophilic addition nucleophilic addition electrophilic aromatic substitution If you can provide an example, that would be great :)
What are the similarities and differences between the two tests for the difference between two population...
What are the similarities and differences between the two tests for the difference between two population means? Under what condition should we use the test for the matched samples?
Explain what the difference is between the alkyl substitution reactions and addition/elimination type reactions in EAS...
Explain what the difference is between the alkyl substitution reactions and addition/elimination type reactions in EAS (electrophilic aromatic substitution).
Are these two statements correct? Statement 1: Alpha is the difference between a real return and...
Are these two statements correct? Statement 1: Alpha is the difference between a real return and a benchmark return. If the benchmark is too low (high), the alpha will be too high (low). This is the “joint hypothesis problem.” Any test of market efficiency is also jointly a test of the underlying assumed equilibrium model. Statement 2: Long-run abnormal returns are more difficult to establish than short-run abnormal returns. A. Both statements are correct. B. Both statements are incorrect. C....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT