Skip to content

Instantly share code, notes, and snippets.

@mephir
Created November 25, 2018 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mephir/a3181435a259babfe3e7dce8a48d7013 to your computer and use it in GitHub Desktop.
Save mephir/a3181435a259babfe3e7dce8a48d7013 to your computer and use it in GitHub Desktop.
#include<stdio.h>
int wczytaj_float(float * liczba);
void idioto_ochrona_dla_D1(float * liczba);
int main() {
float lic;
idioto_ochrona_dla_D1(&lic);
printf("Liczba: %f\n", lic);
return 0;
}
int wczytaj_float(float * liczba) {
float num;
printf("Podaj liczbe: ");
if (scanf("%f", &num) != 1) {
scanf("%*s");
return 0;
}
*liczba = num;
return 1;
}
void idioto_ochrona_dla_D1(float * liczba)
{
while (wczytaj_float(liczba) != 1) {
/* nie musimy tutaj nic robic ;) */
printf("Zla liczba :)\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment