Remotely Creating Variables

This is a discussion on Remotely Creating Variables within the C++ Programming forums, part of the General Programming Boards category; Is it possible to have someone type up a text file (*.txt) so that when the program starts, it will ...

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    5

    Remotely Creating Variables

    Is it possible to have someone type up a text file (*.txt) so that when the program starts, it will use variables declared in the text file as real variables, or would I have to have a pre-defined set of variables?

    If that's not possible, then would it be possible to have a text-file set some variables?

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    Yes it's possible. You could design a class to hold the variable's information like it's name and size and create a new class object each time a new variable declarion is found in the file. It wouldn't be as efficant as variables declared in the program but this is the sort of thing that makes scripting languaes less efficant then compiled programs.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. basic question about global variables
    By radeberger in forum C++ Programming
    Replies: 0
    Last Post: 04-06-2009, 12:54 AM
  2. Best way to avoid using global variables
    By Canadian0469 in forum C++ Programming
    Replies: 7
    Last Post: 12-18-2008, 11:02 AM
  3. Replies: 15
    Last Post: 09-30-2008, 02:12 AM
  4. Classes, dynamic variables, and leaks.
    By Grins2Pain in forum C++ Programming
    Replies: 8
    Last Post: 09-26-2003, 03:07 PM
  5. static variables
    By Luigi in forum C++ Programming
    Replies: 4
    Last Post: 04-24-2003, 07:13 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21