Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#Actualboogyman19946

Posted 13 January 2012 - 01:51 PM

I believe the language in question is C, not C#, alas, the new keyword is non existent, nor are constructors.

To the OP, I take it you have not yet covered dynamic memory. If you have not, you can always create an array of stations (if you haven't learned about arrays, I guess you can create a "StationManager" struct and put however many stations you want) and each station could contain a variable rather it's activated or not (this will be very painful to code. It will be much easier if you use arrays). This little hack should allow you to do what you want, but you should probably limit your use of it to this program only Posted Image Besides, this setup is limited to a static number of stations.

Of course, the best solution is to use malloc() and free() to create them during execution. I don't know why I didn't mention that.

#4boogyman19946

Posted 10 January 2012 - 08:14 PM

I believe the language in question is C, not C++, alas, the new keyword is non existent, nor are constructors.

To the OP, I take it you have not yet covered dynamic memory. If you have not, you can always create an array of stations (if you haven't learned about arrays, I guess you can create a "StationManager" struct and put however many stations you want) and each station could contain a variable rather it's activated or not (this will be very painful to code. It will be much easier if you use arrays). This little hack should allow you to do what you want, but you should probably limit your use of it to this program only Posted Image Besides, this setup is limited to a static number of stations.

Of course, the best solution is to use malloc() and free() to create them during execution. I don't know why I didn't mention that.

#3boogyman19946

Posted 10 January 2012 - 02:45 PM

I believe the language in question is C, not C++, alas, the new keyword is non existent, nor are constructors.

To the OP, I take it you have not yet covered dynamic memory. If you have not, you can always create an array of stations (if you haven't learned about arrays, I guess you can create a "StationManager" struct and put however many stations you want) and each station could contain a variable rather it's activated or not (this will be very painful to code. It will be much easier if you use arrays). This little hack should allow you to do what you want, but you should probably limit your use of it to this program only Posted Image Besides, this setup is limited to a static number of stations.

#2boogyman19946

Posted 10 January 2012 - 02:44 PM

I believe the language in question is C, not C++, alas, the new keyword is non existent, nor are constructors.

To the OP, I take it you have not yet covered dynamic memory. If you have not, you can always create an array of stations (if you haven't learned about arrays, I guess you can create a "StationManager" struct and put however many stations you want) and each station could contain a variable rather it's activated or not. This little hack should allow you to do what you want, but you should probably limit your use of it to this program only Posted Image Besides, this setup is limited to a static number of stations.

#1boogyman19946

Posted 10 January 2012 - 02:38 PM

I believe the language in question is C, not C++, alas, the new keyword is non existent, nor are constructors.

To the OP, I take it you have not yet covered dynamic memory. If you have not, you can always create an array of stations (if you haven't learned about arrays, I guess you can create a "StationManager" struct and put however many stations you want) and each station could contain a variable rather it's activated or not. This little hack should allow you to do what you want, but you should probably limit your use of it to this program only :D

PARTNERS