|
|
|
#if и ошибка
|
|||
|---|---|---|---|
|
#18+
Код: plaintext 1. 2. 3. 4. 5. 6. На C++ Builder 6 "это" работало нормально. На Visual Studio 2005 "это" выдаёт ошибку "fatal error C1017: invalid integer constant expression". Как написать это же по другому тут чтобы работало? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 18.07.2006, 07:00 |
|
||
|
#if и ошибка
|
|||
|---|---|---|---|
|
#18+
По всей видимости sizeof является предопределенным макросом препроцессора борланда. В вижуал с, он по всей видимости отстутсвует, так как он не определен стандартом С++. А функциями препроцессор оперировать не может. тынц ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 18.07.2006, 11:12 |
|
||
|
#if и ошибка
|
|||
|---|---|---|---|
|
#18+
Т.е. не функциями, а операторами С++ ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 18.07.2006, 11:13 |
|
||
|
#if и ошибка
|
|||
|---|---|---|---|
|
#18+
msdnThe constant-expression is an integer constant expression with these additional restrictions: Expressions must have integral type and can include only integer constants, character constants, and the defined operator. The expression cannot use sizeof or a type-cast operator. The target environment may not be able to represent all ranges of integers. The translation represents type int the same as type long, and unsigned int the same as unsigned long. The translator can translate character constants to a set of code values different from the set for the target environment. To determine the properties of the target environment, check values of macros from LIMITS.H in an application built for the target environment. The expression must not perform any environmental inquiries and must remain insulated from implementation details on the target computer. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 18.07.2006, 11:16 |
|
||
|
|

start [/forum/topic.php?fid=57&msg=33860023&tid=2030829]: |
0ms |
get settings: |
8ms |
get forum list: |
16ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
89ms |
get topic data: |
9ms |
get forum data: |
3ms |
get page messages: |
38ms |
get tp. blocked users: |
1ms |
| others: | 246ms |
| total: | 416ms |

| 0 / 0 |
