Hello
I am trying to give some input with scanf() but it doesnt work.
Does anyone has an idea wy? My terminal doesnt ask me to give a char.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct album{
char band[20];
char CDtitel[50];
int year;
char songs[3][30];
struct album *next;
};
typedef struct album *palbum;
void voegAlfToe(struct album album1, palbum *list);
int main (void){
int i;
char inputTest;
char isTrue = 1, anotherAlbum;
palbum list;
struct album album1;
printf("Press a to add a album\n");
while (isTrue){
scanf("%c", &inputTest);
switch (inputTest){
case 'a' :
printf("Band\n");
scanf("%s", album1.band);
printf("CDtitel\n");
scanf("%s", album1.CDtitel);
printf("year\n");
scanf("%i", &album1.year);
printf("songs\n");
for (i = 0; i < 3; i++)
scanf("%s", album1.songs[i]);
/* voegAlfToe(album1, &list);*/
isTrue = 0;
break;
}
/* if (inputTest == 'a'){
printf("Do you want to add another album: press a else press any key\n");
scanf("%c", &anotherAlbum);
printf("dsfd\n");
if (anotherAlbum != 'a')
isTrue = 0;*/
}
scanf("%c", &inputTest);
return 0;
}