Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <ctype.h>
- #include <string.h>
- char *toUpper(char *str){
- int hossz = strlen(str);
- int i;
- for (i = 0; i < hossz; i++)
- {
- if (str[i] >= 'a' && str[i] <= 'z')
- {
- str[i] - 'a' + 'A';
- }
- return str;
- }
- }
- void vizsgalat(const int argc, char *argv){
- if (argc < 1 )
- {
- fprintf(errorfile.txt, "No argument.");
- return 1;
- }
- else{
- for (int i = 1; i < argc; ++i)
- {
- printf("%s\n",toUpper(argv[i]));
- }
- return 0;
- }
- }
- int main(int argc, char **argv)
- {
- for (int i = 1; i < argc; ++i)
- {
- if(vizsgalat(argv[i])==0)
- {
- printf("%s\n",toUpper(argv[i]));
- }
- else
- {
- exit;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement