answersLogoWhite

0


Best Answer

void *

wlen= fwrite ((void *)&data, 1, sizeof (data), file);

if (wlen != sizeof (data)) ... error ...

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: First argument of fwrite function is typecast to?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What happen when a c program passes an array as a function argument?

When an array name is passed as a function argument, the address of the first element is passed to the function. In a way, this is implicit call by reference. The receiving function can treat that address as a pointer, or as an array name, and it can manipulate the actual calling argument if desired.


What is argument in c plus plus?

If this is a homework assignment, please consider trying to answer it yourself first, otherwise the value of the reinforcement of the lesson offered by the assignment will be lost on you.An argument (or parameter) in C or C++ is a special variable that is passed to a function when it is called. In the example...float sin(float x);... the x is an argument. Within the body of the function, x refers to the copy of the caller's argument that was passed to the function.


Why should a function that accepts an array as an argument and processes that array also accept an argument specifying the array?

Basically in c++ passing an array as an argument only provides a pointer to the first value and that function won't know how many values it has.If you read beyond the size you will just get garbage from memory.


What will be the prototype of a user defined function?

In C programming, there are no built-in functions; all functions are user-defined. In order to use a function it must first be declared. This can be achieved by importing the header file containing the declaration (via the #include compiler directive) or by typing the declaration by hand. The definition (implementation) of a function is not required in order to use a function, but if a function is used it has to be defined somewhere (undefined functions will cause a link error). Where a function is used by several translation units, placing the declaration in a header file ensures the declaration is consistent across all translation units. Grouping declarations by purpose allows us to import several declarations at once. Declarations that are not used are simply ignored. A declaration informs the compiler of the function's name and type, and the number and type of its arguments, if any. This describes the interface to the function. A function's type is denoted by its return type. A function that has no return value is simply declared void (no type). The return type always comes first in a declaration, followed by the function name, which must be a unique identifier within the scope in which it is declared (global or local scope). A local name will mask a global name, effectively hiding it from the local scope. Function arguments (the formal arguments of the function) are delimited by parenthesis after the function name. A single argument of type void denotes no arguments while multiple argument types must be separated by commas (void types are not permitted in a multiple argument function). The complete declaration is terminated by a semi-colon immediately after the closing parenthesis. If the declaration is also a definition, the function body (the implementation) replaces the closing semi-colon. To assist with documentation, the formal arguments of a declaration may be named (unless the argument is void). However, where names are given, they need not match the corresponding names provided by a function's definition, where defined separately. Using longer descriptive names in the declaration helps document their purpose, while the definition can use shorter names that are easier to work with.


Difference between sizeof and strlen?

The sizeof operator returns the total size, in bytes, of the given operand, whereas the strlen function returns the number of characters in the argument up to but not including the first null-terminator.Consider a character buffer allocated 50 bytes to which you assign the string "Hello world". The sizeof operator will return 50, but the strlen function returns 11.

Related questions

What happen when a c program passes an array as a function argument?

When an array name is passed as a function argument, the address of the first element is passed to the function. In a way, this is implicit call by reference. The receiving function can treat that address as a pointer, or as an array name, and it can manipulate the actual calling argument if desired.


What is the first argument required by Excel's built-in IF function?

For my example you have a number '2' in cell D4 The first argument would be: Logical Test. Example of IF Argument: =IF(Logical Test, True, False) So the logical test is what you are testing, IF Cell D4=2, the value would be true, if it didn't equal 2 the value would be false.


What is argument in c plus plus?

If this is a homework assignment, please consider trying to answer it yourself first, otherwise the value of the reinforcement of the lesson offered by the assignment will be lost on you.An argument (or parameter) in C or C++ is a special variable that is passed to a function when it is called. In the example...float sin(float x);... the x is an argument. Within the body of the function, x refers to the copy of the caller's argument that was passed to the function.


What is the best way to write an array to a file in PHP?

The serialize() function is used to create a storable representation of a variable in PHP.To store an array to a file, you first use the serialize() function to change an array into a string. Save the string in a file using file I/O, so fwrite() or a similar function. When reading it use unserialize() to get the original array again.


What are the compsition of function?

A composition function, regarding two functions, is when you apply the first function on the second function on an argument. Bear in mind that a single, unaltered function is when you apply said function to an argument; a composition function simply applies the result of an application as an argument to another function. For example, if one function is defined as f(x) = x + 4 and another is defined as g(x) = 2x, the composition of the two (where f is applied to g) is f(g(x)) = 2x + 4. Note that composition is not commutative; that is, f(g(x)) is not necessarily equivalent to g(f(x)), unless if the functions are either the same or inverses of each other, in which case the result will be the argument; f(f-1(x)) = f-1(f(x)) = x.


What is the first argument required by the built-in IF function?

For my example you have a number '2' in cell D4 The first argument would be: Logical Test. Example of IF Argument: =IF(Logical Test, True, False) So the logical test is what you are testing, IF Cell D4=2, the value would be true, if it didn't equal 2 the value would be false.


What is the formula for base and power in java program?

powpublic static double pow(double a, double b) Returns the value of the first argument raised to the power of the second argument. Special cases: If the second argument is positive or negative zero, then the result is 1.0.If the second argument is 1.0, then the result is the same as the first argument.If the second argument is NaN, then the result is NaN.If the first argument is NaN and the second argument is nonzero, then the result is NaN.If the absolute value of the first argument is greater than 1 and the second argument is positive infinity, orthe absolute value of the first argument is less than 1 and the second argument is negative infinity,then the result is positive infinity.If the absolute value of the first argument is greater than 1 and the second argument is negative infinity, orthe absolute value of the first argument is less than 1 and the second argument is positive infinity,then the result is positive zero.If the absolute value of the first argument equals 1 and the second argument is infinite, then the result is NaN.If the first argument is positive zero and the second argument is greater than zero, orthe first argument is positive infinity and the second argument is less than zero,then the result is positive zero.If the first argument is positive zero and the second argument is less than zero, orthe first argument is positive infinity and the second argument is greater than zero,then the result is positive infinity.If the first argument is negative zero and the second argument is greater than zero but not a finite odd integer, orthe first argument is negative infinity and the second argument is less than zero but not a finite odd integer,then the result is positive zero.If the first argument is negative zero and the second argument is a positive finite odd integer, orthe first argument is negative infinity and the second argument is a negative finite odd integer,then the result is negative zero.If the first argument is negative zero and the second argument is less than zero but not a finite odd integer, orthe first argument is negative infinity and the second argument is greater than zero but not a finite odd integer,then the result is positive infinity.If the first argument is negative zero and the second argument is a negative finite odd integer, orthe first argument is negative infinity and the second argument is a positive finite odd integer,then the result is negative infinity.If the first argument is finite and less than zero if the second argument is a finite even integer, the result is equal to the result of raising the absolute value of the first argument to the power of the second argumentif the second argument is a finite odd integer, the result is equal to the negative of the result of raising the absolute value of the first argument to the power of the second argumentif the second argument is finite and not an integer, then the result is NaN.If both arguments are integers, then the result is exactly equal to the mathematical result of raising the first argument to the power of the second argument if that result can in fact be represented exactly as a double value.(In the foregoing descriptions, a floating-point value is considered to be an integer if and only if it is finite and a fixed point of the method ceil or, equivalently, a fixed point of the method floor. A value is a fixed point of a one-argument method if and only if the result of applying the method to the value is equal to the value.)A result must be within 1 ulp of the correctly rounded result. Results must be semi-monotonic.Parameters:a - the base.b - the exponent.Returns:the value ab.Taken from the Java api.


What is initcap?

the initcap function sets the first character in each word to uppercase and the rest to lowercase.The syntax for the initcap function is:initcap( string1 )string1 is the string argument whose first character in each word will be converted to uppercase and all remaining characters converted to lowercase.


Why should a function that accepts an array as an argument and processes that array also accept an argument specifying the array?

Basically in c++ passing an array as an argument only provides a pointer to the first value and that function won't know how many values it has.If you read beyond the size you will just get garbage from memory.


What is the first sentence of a argument paragraph?

intoroduction


He who raises his voice first loses?

the argument.


How do you refer to the first argument supplied by a user in a shell script?

The first argument is always $1. It may or may not exist, but is always referred to by $1.