- 신규로 표시
- 북마크
- 구독
- 소거
- 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 응답