Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdlib.h>
- #include<stdio.h>
- #include<string.h>
- #define cit(x) scanf("%s",x)
- void citireeeee(char *s, char a[100])
- {
- s = (char*)malloc(strlen(a) + 1);
- strcpy(s, a);
- }
- int main()
- {
- char *s, a[100];
- enum{iesire, citire, afisare, salvare}opt;
- do {
- printf("0. Iesire\n");
- printf("1. Citire\n");
- printf("2. Afisare\n");
- printf("3. Fisier\n");
- printf("opt= ");
- scanf("%d", &opt);
- switch (opt)
- {
- case iesire:exit(0);
- break;
- case citire:
- printf("Dati sirul: ");
- cit(a);
- citireeeee(s, a);
- printf("%s",s);
- break;
- case afisare:
- break;
- case salvare:
- break;
- default:
- break;
- }
- } while (1);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement