Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Write a program named ALPHA that asks for the user’s name. Then
- have ALPHA call a program named BETA that displays the user’s name. */
- /* Both programs are listed here: don't compile. Also make sure you
- provide the right path to beta and specify the right number of elements
- in the app array. */
- /* alpha.c source code */
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- int main()
- {
- char name[16];
- char app[29] = "~/Test/beta ";
- puts("Enter your name (not more than 14 characters): ");
- fgets(name, 15, stdin);
- system(strcat(app, name));
- return(0);
- }
- /* beta.c source code */
- #include <stdio.h>
- int main(int argc, char *argv[])
- {
- printf("Your name is %s\n", argv[1]);
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement