|
|
|
int ##x
|
|||
|---|---|---|---|
|
#18+
Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. Выдает ошибку: example.cpp(9) : error C2065: 'intx' : undeclared identifier Почему препроцессор видит intx, а не int x? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 28.08.2004, 04:31 |
|
||
|
int ##x
|
|||
|---|---|---|---|
|
#18+
Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. Такой код рабочеспособен. Только почему появляется проблема с int ##x, пока не понятно. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 28.08.2004, 04:39 |
|
||
|
int ##x
|
|||
|---|---|---|---|
|
#18+
// a zacem ispolizovati ##, bez nih toje rabotaet ... #include<iostream> using namespace std; #define foreach(x,a,b,c) for (int x=a; x<b; x+=c) int main(void) { foreach(x,1,8,2) cout<<x<<endl; foreach(b,1,8,2) cout<<b<<endl; return 0; } ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 28.08.2004, 12:26 |
|
||
|
int ##x
|
|||
|---|---|---|---|
|
#18+
Token-Pasting Operator (##) The double-number-sign or “token-pasting” operator (##), which is sometimes called the “merging” operator, is used in both object-like and function-like macros. It permits separate tokens to be joined into a single token and therefore cannot be the first or last token in the macro definition. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 30.08.2004, 12:34 |
|
||
|
|

start [/forum/topic.php?fid=57&fpage=435&tid=2034487]: |
0ms |
get settings: |
10ms |
get forum list: |
21ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
88ms |
get topic data: |
14ms |
get forum data: |
3ms |
get page messages: |
52ms |
get tp. blocked users: |
2ms |
| others: | 223ms |
| total: | 421ms |

| 0 / 0 |
