answersLogoWhite

0


Best Answer

Possible ways:

void byvalue (MyClass param);

void byptr (MyClass *paramptr);

void byref (MyClass &paramref);

MyClass c;

byvalue (c);

byptr (&c);

byref (c);

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How can objects be passed as a function parameters in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Call by function in c language?

I guess you meant the following:'In C language, when you call a function,the parameters are passed by-value.'


What is true about the parameters of a function (Python 3)?

a. Functions can have only one parameter. b. The order in which the parameters are defined matters. c. Parameters can be passed to a function in any order. d. Parameters have no order.


What is the smallest number of formal parameters that can be included in a function definition in C?

You can have a function with no parameters.


How are the strings passed to a function?

By reference. The name of the string is converted to a pointer (in C/C++) and given to the function as the address of the first element. (In Java, all objects are passed by reference, and there are no pointers.)


What does the function counter do and what are its parameters?

There is no builtin function 'counta' in C.


Which is the function which destroys objects in C?

No objects in C. For C++, it is destructor.


What is parameters in C plus plus?

In C++, parameters are variables declared in the function's declaration and definition that receive values passed in from the function call. They are used to pass values or data into a function to be used within the function's code. Parameters allow functions to be more flexible and reusable by accepting different inputs without needing to modify the function's code.


What is a function in 'c'?

A function in C++ are a set of command or a piece of code that needs to be executed again and again with different or same parameters for expample void somefunc() { cout<<"Hello"; } will print hello whenever the function is called or int add(int a,int b) { return a+b; } This function will return the sum of the parameters passed to invoke this function you need to write a line add(4,5); and it will return "9"


Relationship between actual and formal arguments?

The formal arguments are the names given to the parameters/arguments in the function declaration. These names will be used within the body of the function. void myFunc( int i, char c ); // Function prototype The actual arguments are the variables and/or constants (those supplied by the caller) that are used when invoking the function. int intVar = 6; char charVar = 'e'; // Actual parameters 3 and 'G' will be mapped to the // formal parameters 'i' and 'c' myFunc( 3, 'G' ); // Execute function // Actual parameters 'intVar' and 'charVar' will be mapped // to the formal parameters 'i' and 'c' myFunc( intVar, charVar ); // Execute function


When calling a function that has multiple parameters can you list the arguments in any order?

No. C function argument are positional.


What is an operator overloading in C?

one function but multiple behaviours depending on the parameters


What is meant by function declaration in C language?

The name of the function is established by what is called function declaration. It also establishes the number and the types of parameters.