answersLogoWhite

0


Best Answer

Implicit and explicit determine what can be passed to a method. If a method is not declared as explicit the compiler will attempt to look for any implicit conversions from the type being passed to the type the method expects. for example, if the method expects a long and you pass in an unsigned char, the compiler will not complain because an unsigned char can be implicitly converted to a long without any loss of data. If you declare the method as explicit the data type that is used in the method declaration is the data type that needs to be passed to the method. If you want to pass a char *ptr to a method that expects a long you will have to cast the char *ptr to a long when calling the method. For example, foo((long)ptr);

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the Difference between implicit and explicit variable declaration?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Math & Arithmetic

Difference between declaring a variable and definition a variable?

Declaration is a promise: 'I will define (or has defined) this variable/function somewhere else'.


What is the difference between declaring variable and initializing variables?

Actually, there is a third step, call definition. Declaration is a statement to the compiler of what type an identifier is, definition is the allocation of memory for that identifier, and initialization is the assignment of an initial value to that identifier. Usually, declaration and definition are done together, but you can also add initialization in that step if desired. int a; /* declaration and definition */ a = 1; /* initialization */ int a = 1; /* declaration, definition, and initialization */ For the case of seperate declaration and definition, consider the struct... struct _mystruct { int a; }; /*declaration */ struct _mystruct mystruct; /* definition */ struct _mystruct { int a; } mystruct; /*declaration and definition */ Note: To be more precise: struct _mystruct; /* struct declaration */ struct _mystruct { int a; }; /* struct definition */ typedef struct _mystruct MYTYPE; /* type definition */ extern struct _mystruct mystructvar; /* variable declaration */ struct _mystruct mystructvar; /* variable definition */ struct _mystruct mystructvar = {7} ; /* variable definition with initialization */ struct _mystruct { int a; } mystruct; /* struct definition and variable definition */ extern struct _mystruct { int a; } mystruct; /* struct definition and variable declaration */


Difference between variable resistor and rheostat?

The difference between a variable resistor and a rheostat is the same as the difference between six and half a dozen.


What is the difference between a variable and a literal in prgramming?

a literal is a constant value, the difference is a variable can change it's value.


What is one difference between a variable expression and a numerical expression?

The variable.

Related questions

Difference between declaring a variable and definition a variable?

Declaration is a promise: 'I will define (or has defined) this variable/function somewhere else'.


What is the difference between implicit and explicit function?

implicit function is a function in which the dependent variable has not been given "explicitly" in terms of the independent variable. To give a function f explicitlyis to provide a prescription for determining the outputvalue of the function y in terms of the input value x: : :: y = f(x). By contrast, the function is implicit if the value of y is obtained from x by solving an equation of the form: : :: R(x,y) = 0. That is, if it is defined as the level set of a function in two variables: one variable or the other may determine the other, but one is not given an explicit formula for one in terms of the other. Formally, a function f:X→Y is said to be an implicit function if it satisfies the equation : :: R(x,f(x)) = 0 for all x∈X, where R is a function on the Cartesian product X × Y. Every function R defines an isocontour


What is the difference between Declaration and Assignment?

Declaration is basically defining data type and length and assignment is to assign the value. Below is the declaration -- var a integer /* this means we are declaring a variable a as integer data type */ a= 5 /* this is assignment,we are assigning 5 to variable a */


What is Variable declaration and variable initialization?

...are important things in programming. Example: extern int variable; /* declaration */ int variable= 8; /* definition with initialization */


What is the difference between an explicit rule and a recursive rule?

An explicit rule defines the terms of a sequence in terms of some independent parameter. A recursive rule defines them in relation to values of the variable at some earlier stage(s) in the sequence.


What is the difference between variable declared inside the declaration part and variable declared in scriptlet part?

Variable declared inside declaration part is treated as a global variable, which means after translation of jsp file into servletthat variable will be declared outside the service method as an instance variablethe scope is available to the complete jspVariable declared inside a scriplet will be declared inside a service method as a local variable and the scope is with in the service method.


What is a hole-in-scope?

when inner declaration of a variable hides its outer declaration


What is the optional in a variable declaration statement?

Optional is the assignment of the value of course.int number; //Variable Declarationint number=2; //Assignment Declaration


How a variable is declared and initialized during declaration in c?

During declaration, the declaration goes like this: extern <type> <variable-name> or <type> <function-name> (<parameter list>);


What is a declaration of value?

Maybe you misinterpret something? There doesnt seem to be a declaration of value, but maybe declaration of variable?


Where the declaration of c variable can be done?

at orchard road on the shop where the variable can be done.


What is different between a definition and declaration of a variable?

A declaration introduces the existence of a variable by specifying its data type and name, such as "int a;". A definition, in addition to declaring the variable, also allocates memory for it, such as "int a = 5;".