Add results of first lecture.
This commit is contained in:
parent
6d68ec02fb
commit
bfd1ec33f8
27
00_pufferueberlauf/pufferueberlauf.c
Normal file
27
00_pufferueberlauf/pufferueberlauf.c
Normal file
@ -0,0 +1,27 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
void showSecretInformation()
|
||||
{
|
||||
printf("Erfolg!\n");
|
||||
}
|
||||
|
||||
int checkPassword()
|
||||
{
|
||||
char buffer[6];
|
||||
|
||||
printf("Bitte Passwort eingeben: ");
|
||||
scanf("%5s", buffer);
|
||||
|
||||
return strcmp(buffer, "pass") == 0;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
if(checkPassword())
|
||||
showSecretInformation();
|
||||
else
|
||||
printf("Falsches Passwort!\n");
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user