| |

VerySource

 Forgot password?
 Register
Search
Author: traelc

Question about const?

[Copy link]

0

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-2-8 20:15:01
| Show all posts
statement.
Is this the definition?
extern const int&ri = a
Reply

Use magic Report

0

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-2-8 21:45:01
| Show all posts
a typo
Is this the definition?
extern const int&ri = a
Reply

Use magic Report

0

Threads

6

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-2-13 14:30:01
| Show all posts
Declare it
Reply

Use magic Report

0

Threads

55

Posts

44.00

Credits

Newbie

Rank: 1

Credits
44.00

 Invalid IP Address

Post time: 2020-2-20 12:15:01
| Show all posts
In C ++, there is an important difference between declarations and definitions: declarations can be repeated multiple times, and definitions can only be made once.
So if you write the code twice, you can compile and pass the declaration, but not the definition.
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-2-24 13:15:01
| Show all posts
Master upstairs
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-3-1 21:15:02
| Show all posts
Of course it's a statement
Reply

Use magic Report

1

Threads

27

Posts

23.00

Credits

Newbie

Rank: 1

Credits
23.00

 China

Post time: 2020-3-9 20:45:01
| Show all posts
statement
Reply

Use magic Report

3

Threads

10

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

Post time: 2020-4-16 10:45:01
| Show all posts
err said upstairs that there is such a const variable in some place, it will be found when linking
You can report errors when compiling
Reply

Use magic Report

0

Threads

4

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 United States

Post time: 2020-4-29 20:30:02
| Show all posts
Hehe learning
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