16

So, for my C class, the computers in the lab are using VS 2015. To be able to compile C we have to change some settings to allow the program to compile.
I like to use my computer (with Arch Linux) and use my tools (Vim and GCC).

The guy next to me was trying to do the homework, but he was struggling. I decided to give it a shot and I was able to do it, so I showed him my code and he tried it in the computer.
The program crashes every time no matter what. We asked the professor. I show him my code and how it's working. Apparently he was confused because I was using the terminal and not VS. So he proceeded to said that it's because I'm not using VS2015 and GCC is doing the whole work for me.

I'm like ಠ_ಠ and then he keeps saying that he doesn't know what or how GCC works (for real? Someone that teaches C and has a Ph. D on CS doesn't now what GCC is?) but that it is apparently doing everything for me. So my code should be wrong if it crashes on VS2015.... ಠ_ಠ

What do you think? I'm thinking about talking with the head department of CS (I know that he is a Linux guy) and see what happens. Should I do it? Or should I just use VS2015 as the "professor" is asking?
I even tried online compilers to see if it was just working on my computer, but even they use GCC to compile.

Comments
  • 2
    -wno-deprecated or -pedantic-errors
  • 10
    You should totally speak to someone with authority about this. Think of all the clueless students wasting time with this fraud.

    No wonder half of the people applying for programming jobs can't even write a simple fizzbazz, if they get the idea how programming works from people like this.
  • 1
    @LeFlawk well, I know now who is the real head of department. I will talk to him tomorrow or Monday because I figured out how was him when he was already out of campus. I'm trying to make this code working on VS2015 and it's not working for any weird reason...

    Also, I remember that he said that it was wrong to use char instead of int to count the length of a string (he gave us the base code with a hardcode restriction of 20 characters for the string) so a char should be enough, right? He said to me that chars are a waste of space in this case because its size is bigger than a int ಠ_ಠ (isn't a char 1 byte and an int 4?) Honestly, I don't know what to think anymore...
  • 1
    @infinite-lifes I will! Now I have his card and will contact him. I prefer to see him in person to show him that it's working everywhere but VS2015 (even OS X).
  • 1
    @LeFlawk

    #include <stdio.h>

    int length(char * p){
    char i;
    for (i = 0; p[i] != '\0'; ++i);
    return i;
    }

    main(){
        int len;
        char str[20];
        printf("Input string: ");
        scanf("%[^\n]%*c", str);
        len = length(str);
        printf("The length of string is %d. \n", len);
    }

    He gave us the main function, we just have to code the length function. It works using char, int, ++i or i++ (he also complaint because I was using ++i instead of i++)
Add Comment