| |

VerySource

 Forgot password?
 Register
Search
Author: 409616177

Very strange question

[Copy link]

0

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-3-30 10:15:01
| Show all posts
I also think that the function declaration is inconsistent with the definition.
Reply

Use magic Report

0

Threads

4

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-4-17 17:15:01
| Show all posts
#include <iostream>
using namespace std;
int k = 1;
int main ()
{
int i = 4;
// #####################################
int fun (int); // Note that the return type here is int
// #################################

fun (i);
cout << "(1)" << i << ',' << k << endl;
return 0;
}
// ############################################# ######
void fun (int m) // The type defined here is void,
// ¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥
{
m + = k;
k + = m;
{/// The braces are many
char k = 'B';
cout << "(2)" << char (k-'A ') << endl;
} ///// Ibid
cout << "(3)" << m << ',' << k << endl;
}


// It means that there is a function with the same name that has no life and starts to be defined
And a declared function is not defined
Reply

Use magic Report

0

Threads

24

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-7-1 00:30:02
| Show all posts
1. The return type is inconsistent
I just declared a function, but it is not defined.
.

Think about yourself
Reply

Use magic Report

0

Threads

9

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-7-1 15:45:01
| Show all posts
No function can be defined in the function body! !
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list