20 lines
409 B
C
20 lines
409 B
C
#include "eingabe.h"
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
|
|
int gibTextEin(const char *promptText, char *puffer, unsigned int maxLen)
|
|
{
|
|
if(fgets(puffer, maxLen, stdin) == NULL)
|
|
return 0;
|
|
else
|
|
{
|
|
if(puffer[strlen(puffer)-1] == '\n')
|
|
puffer[strlen(puffer)-1] = '\0';
|
|
else
|
|
while(getchar() != '\n') {}
|
|
|
|
return 1;
|
|
}
|
|
} |