I have a question regarding the following code:
#include <stdio.h>
int main() {
char days[7][10] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
char *pdays[7]= {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
(void) printf("%d\n", days[4] - days[1]);
(void) printf("%d\n", pdays[4] - pdays[1]);
}
If I run it in CLion (Running on OSX MacBook Pro (13-inch, Mid 2012), Processor: 2.5 GHz Intel Core i5, Memory: 4 GB 1600 MHz DDR3) returns
30
8
If I run it in http://www.tutorialspoint.com/compile_c_online.php it returns
30
27
What gives? I'm studying for my ProgC Exam and I don't know what to trust now. Any help would be greatly appreciated.