Strings to Variable Names
-
I am a professional, but unfortunately junior, developer, and I'm looking to do something that I thought I knew how to do. Now, I cannot recall how to do it, and I'm feeling... well, terribly ignorant. What is going on is I want to create an array of arrays - in specific, I'm making a pointer of pointers, actually. I want each of the pointers in the "array" to point at an object of the same type. I wanted to set up a for-loop to assign these. In other words, I have something like: TCSpinEdit ** SpinnerArray; SpinnerArray = new TCSpinEdit *[58]; for (int iCtr = 0; iCtr < 58; iCtr++) the name of each of these objects starts out with CSpin followed by a number, from 1 to 58; so I need to point to CSpin1, then CSpin2, etc. Therefore, I need to generate a string, or whathave you, to designate each CSpin variable to each of the pointes in the array. And I realized I was unsure how to go about this. :) I started originally by using the string class; assign it as: string = "Cspin" + iCtr; But I realized I wasn't sure how to use the string to refer to a variable NAME. Any suggestions? Thanks! James A Beggs Microsoft MSN Mobile Component Test Team
-
I am a professional, but unfortunately junior, developer, and I'm looking to do something that I thought I knew how to do. Now, I cannot recall how to do it, and I'm feeling... well, terribly ignorant. What is going on is I want to create an array of arrays - in specific, I'm making a pointer of pointers, actually. I want each of the pointers in the "array" to point at an object of the same type. I wanted to set up a for-loop to assign these. In other words, I have something like: TCSpinEdit ** SpinnerArray; SpinnerArray = new TCSpinEdit *[58]; for (int iCtr = 0; iCtr < 58; iCtr++) the name of each of these objects starts out with CSpin followed by a number, from 1 to 58; so I need to point to CSpin1, then CSpin2, etc. Therefore, I need to generate a string, or whathave you, to designate each CSpin variable to each of the pointes in the array. And I realized I was unsure how to go about this. :) I started originally by using the string class; assign it as: string = "Cspin" + iCtr; But I realized I wasn't sure how to use the string to refer to a variable NAME. Any suggestions? Thanks! James A Beggs Microsoft MSN Mobile Component Test Team
Please ask programming questions in the programming forums. Visual C++ Forum[^] Jon Sagara I have no complaint with the “mentoring concept” or the marriage concept or the sex concept. But if you pay for any of those, something’s wrong. -- John T. Reed in The real estate B.S. artist detection checklist [^]
-
Please ask programming questions in the programming forums. Visual C++ Forum[^] Jon Sagara I have no complaint with the “mentoring concept” or the marriage concept or the sex concept. But if you pay for any of those, something’s wrong. -- John T. Reed in The real estate B.S. artist detection checklist [^]
er, sorry. :) James A Beggs Microsoft MSN Mobile Component Test Team
-
Please ask programming questions in the programming forums. Visual C++ Forum[^] Jon Sagara I have no complaint with the “mentoring concept” or the marriage concept or the sex concept. But if you pay for any of those, something’s wrong. -- John T. Reed in The real estate B.S. artist detection checklist [^]
er, sorry. :) although it wasnt really for Visual C++; I'm using it in Borland C++ builder, but ok. James A Beggs Microsoft MSN Mobile Component Test Team
-
er, sorry. :) although it wasnt really for Visual C++; I'm using it in Borland C++ builder, but ok. James A Beggs Microsoft MSN Mobile Component Test Team
That just happens to be the unfortunate title of the C++ forum. Jon Sagara I have no complaint with the “mentoring concept” or the marriage concept or the sex concept. But if you pay for any of those, something’s wrong. -- John T. Reed in The real estate B.S. artist detection checklist [^]