answersLogoWhite

0

Yes. Use a control parameter before the variable argument list that determines how many arguments will follow. E.g., the printf() function uses a string parameter as the control parameter. The number of escape sequences in the string determines the number of arguments that are expected to follow, and each escape sequence in the string is expanded from left to right according to the arguments that follow. A simpler approach is to pass the number of arguments that will follow as a named argument. E.g.,

void print_nums(int n, ...)

{

// n tells you how many numbers are to be expected in the va_list.

}

Answer

Yes, there can be solution.

#1: explicitly specifing:

extern void variadic_1 (int n, ...);

variadic_1 (3, "first", "second", "third");

#2: using terminator:

extern void variadic_2 (...);

variadic_2 ("first", "second", "third", NULL);

User Avatar

Wiki User

12y ago

What else can I help you with?

Continue Learning about Engineering

How do you solve declaration syntax error in c program?

The Turbo C++ compiler should tell you what the exact nature of the problem is since syntax errors are, by their very nature, compile-time errors. For instance, you may have made a typo when declaring one of the function's types, or forgotten to include the semi-colon to terminate the declaration. If any arguments are assigned default values, they must all be listed after all the arguments that do not have default values. And no two functions can have the same signature within the same scope or namespace.


What is the physical interpretation of bessel function?

spherical bessel function arise in the solution of spherical schrodinger wave equation. in solving the problem of quantum mechanics involving spherical symmetry, like spherical potential well, the solution that is the wave function is spherical bessel function


What are the situations where overloading function can be an ambiguity?

***Function Overloading and Ambiguity ****We know that compiler will decide which function to be invoked among the overloaded functions. When the compiler could not choose a function between two or more overloaded functions, the situation is called as an ambiguity in function overloading.When the program contains ambiguity, the compiler will not compile the program.The main cause of ambiguity in the program· Type conversion· Functions with default arguments· Functions with pass by referenceType conversion#include using namespace std;#include void fun(int i){ cout


What are types of counter arguments?

Counterarguments can be categorized into several types, including rebuttal, concession, and alternative perspective. A rebuttal directly challenges the opposing argument by presenting evidence or reasoning that undermines it. A concession acknowledges the validity of certain aspects of the opposing viewpoint while maintaining the original stance. An alternative perspective offers a different angle or solution to the issue at hand, suggesting that there are other valid considerations to take into account.


What is expression syntax error?

A syntax error is a coding error that prevents successful compilation. Examples: const int a = 42; void foo (int); void bar (int); void foo () { // syntax error: definition does not match prototype declaration // reason: formal argument not defined // solution: define formal argument } void bar (int b) { if (a = b) { // syntax error in expression: a = b // reason: a is declared constant, cannot assign to constants outside of declaration // solution: did you really mean a == b? } } int main () { // syntax error // reason: return statement not found // solution: return a value to host environment }

Related Questions

What is the function of the spectrophotometer?

spectrophotometer is used to determine the concentration of solution by means of reflectance or transmittance by the solution


How do you determine the concentration of solution?

To determine the concentration of a solution, you would need to separate the solution. You then determine how much of the solution is diluted, and how much is whole.


Weaknesses of deductive and inductive arguments?

Inductive arguments are 100% correct but basicly tell u very little in contrast almost all of our knowledge comes from deductive arguments but they are only 99% certain examples inductive i am a unmarried man All unmarried men are unhappy therefore i am unhappy (note this is also a unsound argument) deductive i poured chemical A into a solution of chemical B it reacted to form a purple solid i poured chemical A into a solution of chemical B it reacted to form a purple solid i poured chemical A into a solution of chemical B it reacted to form a purple solid i poured chemical A into a solution of chemical B it reacted to form a purple solid i poured chemical A into a solution of chemical B it reacted to form a purple solid therefore when i pour chemical A into a solution of chemical B it will react to form a purple solid that is an invalid argument primarily because we cant predict the future and because it snot specific enough the solution to the problem between inductive and deductive is Kant who came up with the synthetic a prori


What is the function of the phenanthroline solution that is added to the unknown iron solution?

Phenanthroline solution is added to unknown iron solution to form a red-colored complex with iron ions. This complex is then used for colorimetric analysis to determine the concentration of iron present in the solution.


How does the strategy of using focus points help you write a problem-and-solution essay?

Using focus points helps in organizing your thoughts and arguments effectively. By identifying specific points to address within the problem and solution framework, you can ensure coherence and clarity in your essay. It also helps in staying on track and delivering a well-structured and persuasive argument to the readers.


To determine or conclude by logical thinking?

To determine or conclude by logical thinking is to analyze information, draw connections between ideas, and reach a sound judgment based on reasoning and evidence. This process involves identifying patterns, evaluating arguments, and making inferences to arrive at a well-supported decision or solution.


You hurt your boyfriend for example through things that were said and feelings that were hurt through arguments how do you repair the relationship to eliminate the awkwardness?

Well....say you're sorry...if you really mean it. Tell him how you really feel. Talk about the argument....find out where things went wrong...then try to come to a solution.


To figure out the exact pH of a solution you'll need to determine the?

You need to determine the percent of hydrogen (pH) molecules in the solution.


How do you determine if a substance was a mechanical mixture or a solution?

In a solution particles are not identifiable.


What is an Airy function?

An Airy function is a function, denoted by A(x), which is a solution to the Airy equation.


What is the function of bicarbonate solution?

A solution of potassium bicarbonate can be used as fungicide.


Which of the following things do prblem solution and persuasive essays have in common?

they both present an argument