home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!uunet.ca!cognos!alanm
- From: alanm@cognos.com (Alan Myrvold)
- Subject: Re: HELP
- Message-ID: <1992Jul31.163558.15163@cognos.com>
- Organization: Cognos Incorporated, Ottawa CANADA
- References: <1992Jul30.154323.12491@cc.umontreal.ca>
- Date: Fri, 31 Jul 1992 16:35:58 GMT
- Lines: 44
-
- In article <1992Jul30.154323.12491@cc.umontreal.ca> mikhail@ERE.UMontreal.CA (Mikhail Ossama) writes:
- >Bonjour
- >SVP le programme suivant ne marche pas ..
- >je sais que vous etes occuper mais SVP essayer de m'aider ..
- >Merci.
-
- Comme ca, peut-etre?
-
- #include <stdio.h>
- #include <stdlib.h>
-
- main(int argc, char *argv[])
- {
- char *cmd_buffer;
-
- if (argc!=4) {
- printf("Usage : ./link prog.f -o prog.exe \n");
- exit(0);
- }
-
- /* allocate a large enough buffer */
- cmd_buffer = (char *) malloc(strlen(argv[1])+strlen(argv[3])+100);
- if (!cmd_buffer) {
- printf("Out of memory!\n");
- exit(0);
- }
-
- /* construct the command */
- sprintf(cmd_buffer,
- "f77 %s -o %s -L/usagers/garcia/gqopt/lib -lgq5 -lthomas -p",
- argv[1],argv[3]);
-
- /* execute it */
- system(cmd_buffer);
-
- /* not necessary to free, since program terminates here, but a good habit */
- free(cmd_buffer);
- }
-
- ---
- Alan Myrvold 3755 Riverside Dr.
- Cognos Incorporated P.O. Box 9707 alanm@cognos.com
- (613) 738-1440 x3317 Ottawa, Ontario
- CANADA K1G 3Z4
-