The C++–Pascal Interface
149
7
The C++ main program,
DayWeatherMain.cc
#include <stdio.h>
#include <string.h>
struct TDayRec {
char TDay[9];
char TWeather[21];
};
extern "C" void DayWeather (
TDayRec [2],
int &);
int main(void)
{
struct TDayRec dr[2];
int NBytes;
char s25[25];
char t25[25];
NBytes = 0;
DayWeather (dr, NBytes);
strncpy (s25, dr[1].TDay, 6);
printf (" day = '%s' \n", s25);
strncpy (t25, dr[1].TWeather, NBytes);
printf (" weather = '%s' \n", t25);
}
Содержание SunSoft Pascal 4.0
Страница 14: ...xiv Pascal 4 0 User s Guide ...
Страница 16: ...xvi Pascal 4 0 User s Guide ...
Страница 30: ...6 Pascal 4 0 User s Guide 1 ...
Страница 160: ...136 Pascal 4 0 User s Guide 6 ...
Страница 268: ...244 Pascal 4 0 User s Guide 11 ...
Страница 320: ...296 Pascal 4 0 User s Guide B ...
Страница 331: ...Index 307 ...
Страница 333: ......