added a struct
This commit is contained in:
parent
97f0e25efb
commit
ec1ab1acd1
@ -1,11 +1,31 @@
|
|||||||
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#define SIZE 128
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
||||||
|
struct student {
|
||||||
|
char name[SIZE];
|
||||||
|
int votes;
|
||||||
|
};
|
||||||
|
|
||||||
|
char meno[SIZE];
|
||||||
char line[SIZE];
|
char line[SIZE];
|
||||||
memset(line,0,SIZE);
|
memset(line,0,SIZE);
|
||||||
char* r = fgets(line,SIZE,stdin);
|
char* r = fgets(line,SIZE,stdin);
|
||||||
if (r == NULL){
|
if (r == NULL)
|
||||||
|
{
|
||||||
|
printf("Chyba: Zlyhalo nacitavanie vstupu.\n");
|
||||||
|
|
||||||
|
}
|
||||||
|
char* end = NULL;
|
||||||
|
int value = strtol(line,&end,10);
|
||||||
|
if (value == 0){
|
||||||
|
// Premena sa nepodarila
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user