[Info-vax] ChatGPT - Joke about OpenVMS and Linux walking into a bar

Arne Vajhøj arne at vajhoej.dk
Sat Dec 31 16:30:10 EST 2022


On 12/31/2022 4:21 PM, Slo wrote:
> This is much better, beats reading the docs and googling for someone new to OpenVMS:
> 
> 1. Code VAX C program to add the first 20 integers
> --------------------------------------------------------------------------------
> Here is a VAX C program that adds the first 20 integers:
> #include <stdio.h>
> int main() {
> int i;
> int sum = 0;
> // Loop through the first 20 integers and add them to the sum
> for (i = 1; i <= 20; i++) {
> sum += i;
> }
> // Print the result
> printf("The sum of the first 20 integers is: %d\n", sum);
> return 0;
> }

It seems to understand C.

> 2. compile link and run
> ------------------------------------
> 
> To compile, link, and run a VAX C program on OpenVMS, you can follow these steps:
> 
>      Compile the program using the CC command. For example:
>      $ CC MYPROG.C
> 
>      Link the program using the LINK command. For example:
>      $ LINK MYPROG, SYS$SHARE:VAXCRTL/OPT
> 
>      Run the program by typing the name of the executable file. For example:
>      $ MYPROG

But again it fails in DCL.

One not optimal (it is not necessary to specify extension .C) and
two not working on a standard VMS system (it is some time since I have
last seen VAX C as opposed to DEC/whatever C, but I do not recall a
SYS$SHARE:VAXCRTL.OPT file).

Arne





More information about the Info-vax mailing list