Question

In: Computer Science

What does the void keyword mean?

What does the void keyword mean?

Solutions

Expert Solution

In C, if the return type of any function is void then it means it will not return anything to the caller. usually such functions are used to print output or display something.

For example:

void dispaly(int * arr,int n)

{

// iterating throuch the array of elements

for(int i=0;i<n;i++)

cout << arr[i] << " " ;

cout << endl;

}

// Sample output:

// say the length of the array is 4: and the elements : 1,5,6,7. So 1,5,6,7 will be displayed and nothing will be returned to the caller.


Related Solutions

What does the static keyword mean?
What does the static keyword mean?
What is a “void” method? What does “pass by value” mean? What is the scope of...
What is a “void” method? What does “pass by value” mean? What is the scope of a variable? What does it mean to say that a method is overloaded?
A. What does void mean? B. Will Java complain if a returned value is not stored/printed?...
A. What does void mean? B. Will Java complain if a returned value is not stored/printed? C. Can you return more than one variable in Java? D. What happens if code exists after a return statement?
what are the differences/similarity between the keyword "this" in java and the keyword "self" in python...
what are the differences/similarity between the keyword "this" in java and the keyword "self" in python and why or when should we use these two keywords? if you could provide a code example side by side that would be great! thank you!
What does the super keyword represents and where can it be used? Give an example of...
What does the super keyword represents and where can it be used? Give an example of a superclass and subclass. Be sure to make all the instances variables of the super class private. Include at least one constructor in each class and ensure that the constructor of the subclass calls the constructor of the superclass. Also include a toString method in both classes that returns the values of the instance variables with appropriate labels. Ensure that the toString method of...
What does it mean to have a good life? What does it mean to be a...
What does it mean to have a good life? What does it mean to be a good person?
What does it mean to be "modern" biologically and culturally? What does it mean to be...
What does it mean to be "modern" biologically and culturally? What does it mean to be human? Antropology 101
What do these terms mean? Numeric classification Archives Subject classification Computerised systems Keyword classification Information management...
What do these terms mean? Numeric classification Archives Subject classification Computerised systems Keyword classification Information management system Alphanumeric classification System integrity Manual systems Chronological classification
What does it mean to be operating a firm in the "long run?"  What does it mean...
What does it mean to be operating a firm in the "long run?"  What does it mean to be operating a firm in the "short run"?  What are the practical implications for managing a business if you are in "short run?"
What does it mean to have a critical lens? What does it mean to have a...
What does it mean to have a critical lens? What does it mean to have a gender/sex lens?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT