- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
I have a variable inside a fortran module that I would like to define based on a defined variable:
module xyz
#if defined BUFSIZE
#define NMWords BUFSIZE
#else
#define NMWords 20
#endif
integer :: NMW = NMWords
end module xyz
Is this legal? In the makefile for this module, I have defined BUFSIZE. When I run this code, NMWords always is 20, even though BUFSIZE should be defined. Any help appreciated!
Never mind. I found the problem. This is legal.
module xyz
#if defined BUFSIZE
#define NMWords BUFSIZE
#else
#define NMWords 20
#endif
integer :: NMW = NMWords
end module xyz
Is this legal? In the makefile for this module, I have defined BUFSIZE. When I run this code, NMWords always is 20, even though BUFSIZE should be defined. Any help appreciated!
Never mind. I found the problem. This is legal.
コピーされたリンク
1 返信