![]() |
|
#1
|
|||
|
|||
User defined data typesDo I create a struct oustide of my main function?
ie. like this: CPP / C++ / C Code:
Last edited by LuciWiz : 07-Oct-2004 at 00:00.
Reason: Please insert your C code between [c] [/c] tags
|
|
#2
|
|||
|
|||
|
Yes, you can do this.
Defining a variable or variable defination outside main() in program file is valid. This way the variable is available for all the functions in the source file i.e. all the function can see LIST definition. Each function can assign its own variable of the type LIST in their code. However these variables will be available only inside those function. In other words, scope of LIST data type is global to program while the locally assigned varibales (inside each function including main()) of type LIST have local scope only inside function. Following is valid. CPP / C++ / C Code:
This is valid too CPP / C++ / C Code:
However this is not valid. CPP / C++ / C Code:
|
Recent GIDBlog
Toyota - 2008 November Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [CONTEST?]Data Structure Test | dsmith | C Programming Language | 2 | 06-Jun-2004 16:13 |
| How to handle user submitted data from a form? | gangster-20 | Web Design Forum | 10 | 22-Apr-2004 08:13 |
| Automate a data change php form | mjfmn | MySQL / PHP Forum | 4 | 20-Oct-2003 10:37 |
| Script needed for letting user input a few days of data for tracking and analysis. | tradertt | MySQL / PHP Forum | 3 | 06-Mar-2003 03:54 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The