943,023 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Marked Solved
  • Views: 3206
  • C RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Nov 18th, 2009
3
Re: Dynamic include in C
Click to Expand / Collapse  Quote originally posted by ahamed101 ...
@twomers

"The #include thing only works on compile time. Not run time" - so you mean the binary will have all the contents of the the included file???
Yes. Its not really all that big a deal since the program has reserved space for the data anyway. Even though you have the arrays declared in if statements the compiler will allocate memory for all of them at the same time somewhere in global memory (since they are declared static). The if statements just limit the scope of those arrays.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5591
Solved Threads: 2280
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,932 posts
since Aug 2005
Nov 18th, 2009
1
Re: Dynamic include in C
This thread is stupid.
ahamed101 -- save the data in files and fopen them according to the input parameters of the program.
OR do what you were doing with the #include and just live with code reuse.
Reputation Points: 453
Solved Threads: 57
Posting Virtuoso
twomers is offline Offline
1,873 posts
since May 2007
Nov 23rd, 2009
-2
Re: Dynamic include in C
Click to Expand / Collapse  Quote originally posted by twomers ...
This thread is stupid.
ahamed101 -- save the data in files and fopen them according to the input parameters of the program.
OR do what you were doing with the #include and just live with code reuse.
I believe no questions are stupid. Please refrain from making such comments in the future.
Reputation Points: 51
Solved Threads: 14
Junior Poster
ahamed101 is offline Offline
114 posts
since Jul 2008
Nov 24th, 2009
2
Re: Dynamic include in C
>> I believe no questions are stupid.
That's naive. And I didn't say the questions was stupid. I said the thread was stupid.

How many times does the same thing have to be said before it's registered?

Gerard -- "The include statement is processed by the preprocessor so it can't be dynamically created in the executable..."
Dave Sinkula -- "The #include directive is like a copy-and-paste that happens at compile time. You can't do it at runtime."
AD -- "No because the #inc lude directive is processed at compile time, not runtime."
Me (Ironically) >> The #include thing only works on compile time. Not run time.

Then you finally say -- "The #include thing only works on compile time. Not run time" - so you mean the binary will have all the contents of the the included file???
Last edited by twomers; Nov 24th, 2009 at 4:27 pm.
Reputation Points: 453
Solved Threads: 57
Posting Virtuoso
twomers is offline Offline
1,873 posts
since May 2007
Nov 24th, 2009
1
Re: Dynamic include in C
Click to Expand / Collapse  Quote originally posted by twomers ...
>> I believe no questions are stupid.
That's naive. And I didn't say the questions was stupid. I said the thread was stupid.

How many times does the same thing have to be said before it's registered?

Gerard -- "The include statement is processed by the preprocessor so it can't be dynamically created in the executable..."
Dave Sinkula -- "The #include directive is like a copy-and-paste that happens at compile time. You can't do it at runtime."
AD -- "No because the #inc lude directive is processed at compile time, not runtime."
Me (Ironically) >> The #include thing only works on compile time. Not run time.

Then you finally say -- "The #include thing only works on compile time. Not run time" - so you mean the binary will have all the contents of the the included file???
Its undeniable, the point you make.
Reputation Points: 499
Solved Threads: 363
Postaholic
gerard4143 is offline Offline
2,189 posts
since Jan 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Need help getting started.
Next Thread in C Forum Timeline: problem with strtok()





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC