Timeline for Accessing const int MAX value from helpers.c
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 23, 2017 at 12:37 | history | edited | CommunityBot |
replaced http://stackoverflow.com/ with https://stackoverflow.com/
|
|
Oct 12, 2014 at 15:17 | comment | added | kzidane |
@AlexandrosAndreou honestly, I don't know much about what's going on underneath the hood, but basically, when you define a global variable, it's actually not just a global variable, but also an externally global variable. All the keyword extern basically does is that it enables you to refer to that variable from another source file. As for the readings, there are recommended textbooks and other online readings. See the "Books" section in the syllabus for more info!
|
|
Oct 12, 2014 at 14:22 | comment | added | Alexandros Andreou |
ok, even though I did not really know what extern was I had a sense that it would just store the variable in some other part of memory. Probably some globally accessible memory while technically if I understood it right, it says go look at that globally accessible memory for its definition as it is given in some other file and it can't be found here. I hope I understood it right. You said it is covered in the readings. I probably lost something in the process, where are the readings? Is there a text book or do you mean the problem sets? Thanks again!
|
|
Oct 12, 2014 at 3:58 | comment | added | kzidane |
@AlexandrosAndreou apparently, this isn't covered in any of the video resources. However, it's covered in the readings. The keyword extern just signals to the system that a globally defined variable from another file is to be accessed.
|
|
Oct 12, 2014 at 3:27 | vote | accept | Alexandros Andreou | ||
Oct 12, 2014 at 3:25 | comment | added | Alexandros Andreou | You are right! This is exactly what I was looking for, thank you for your response. This was not covered in the lectures yet though. So extern just declares something which is defined somewhere else? It is just a compiler instructive keyword and it doesn't change anything in compilation, correct? | |
Oct 12, 2014 at 2:18 | history | answered | kzidane | CC BY-SA 3.0 |