Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int pobierzN(char *N) {
- if (pobierzN != '\0') {
- if (atoi(N) < 1) {
- pomoc();
- exit(EXIT_FAILURE);
- }
- else {
- return atoi(N);
- }
- }
- else {
- pomoc();
- exit(EXIT_FAILURE);
- }
- }
- char* pobierzNazwePliku(char *nazwa_pliku) {
- if (nazwa_pliku != '\0') {
- return nazwa_pliku;
- }
- else {
- pomoc();
- exit(EXIT_FAILURE);
- }
- }
- void parametry(int argc, char *argv[], int *N, char *nazwa_pliku) {
- for (int i = 0; i < argc; i++) {
- if (strcmp(argv[i], "-n") == 0) {
- *N = pobierzN(argv[i + 1]);
- }
- else
- if (strcmp(argv[i], "-f") == 0) {
- strcpy_s(nazwa_pliku, 25, pobierzNazwePliku(argv[i + 1]));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement