Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
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. -
Archer045667y@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... -
Archer045667y@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).
-
Archer045667y@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++)
Related Rants
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.
rant
gcc
if it works is wrong
how does it work?
ಠ_ಠ
c
because fuck you