Home > Back-end >  C and C mixed programming problem
C and C mixed programming problem

Time:10-14

There are two function file a.c
The biggest pp
Biggest pp call a.c function and function passed four parameters, two Pointers and two parameters, two Pointers are no problem, the two parameters is an int type, a type is float, the int type can also be passed in the past, float type pass anyway don't in the past,
Want to ask is what reason,
Compile when programming or whether there are any problems didn't notice, or it is can't do it,

CodePudding user response:

In addition, just try a bit of type double, also can spread

CodePudding user response:

Don't know what meaning is not the past, but it seems there are two special place:

1, float type data values passed automatically converted to double type

2, float and double types in theory when the assignment integer to 10.0, in the form of written is to behind. "0", but it is said that some of the compiler will automatically transform, do not add "0"

CodePudding user response:

At the receiving end you use double try it and see what effect

CodePudding user response:

Double is allowed, has been changed to double, not preach means such as:
Bfloat (float a) {}
Afloat ()
{
Float b=1.0;
Bfloat (b);
}
Bfloat (float a)
{
Printf (" % f ", a);
}

Among them afloat is defined in the c language function, bfloat is defined in the c + + function,
Printf the result of that value is 0.

CodePudding user response:

When declare functions need not add {}!!!!

CodePudding user response:

Questions or function code you write,
C and c + +/there is no this problem
  • Related