- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is even simple code that I would like to be able to build in Visual Studio .NET 2003...
C++:
#include
extern "C" /* this line should be omitted in C */
{
void hello_(long *integ, char *in_str, int in_str_length) {
// must take care of the string since fortran does not provide a
// at the end of the string.
char* str=new char[in_str_length+1];// C++ memory allocation
for (unsigned int i=0; i
str[in_str_length]='';
// normal C/C++ programming here
std::cout << "Hello
";
std::cout << "You passed the following to me:
";
std::cout << "long integer: " << *integ << '
';
std::cout << "string: " << str << '
';
std::cout << "string length: " << in_str_length << "
";
delete[] str;// C++ memory cleanup
}
}
/* Need a small wrapper for the fortran main program, since fortran
code should not be used as the main program, see information
elsewhere */
extern "C" int mymain_();
int main()
{
return mymain_();
}
FORTRAN:
SUBROUTINE MYMAIN
CHARACTER*11 NAME
INTEG=42
NAME='HELLO WORLD'
CALL HELLO(INTEG,NAME)
RETURN
END
Any and all help would be appriecated. Thanks so much......

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page