| | |
Creating Variables on the fly
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2007
Posts: 26
Reputation:
Solved Threads: 1
well i'm a bit of a beginner programmer.. i've taken a few classes but every time i look at a piece of code i get lost easily.
But i do have a question..
I was reading this visual basic book and there was this thing about listing all of these record in order.. kinda like a bunch of arrays.. and organizing them by a certain field.
Well i got to wondering.. all though this would probably be easier if written to a file and taken out one record at a time i guess..
Is it possible to make a variable on the go?
Like say i made a for loop and i only wanted to declare a variable if Something was true, and that changed every time i ran the program. So like a For loop that ran through 100 times. And whatever was true 25%, 50% and 75%
then i'd only want 25 variables, 50 variable then, 75 variables..
so would i be able to make something where i created something like
Variable 1
Variable 2
Variable #
and so on until i didn't need anymore, and then i could easily sort records, and i'd imagine the program would run faster overall. Although i really have no idea i'm more just curious whether it's possible.
Oh and sorry if this is hard to read i'm having trouble expressing my question.
But i do have a question..
I was reading this visual basic book and there was this thing about listing all of these record in order.. kinda like a bunch of arrays.. and organizing them by a certain field.
Well i got to wondering.. all though this would probably be easier if written to a file and taken out one record at a time i guess..
Is it possible to make a variable on the go?
Like say i made a for loop and i only wanted to declare a variable if Something was true, and that changed every time i ran the program. So like a For loop that ran through 100 times. And whatever was true 25%, 50% and 75%
then i'd only want 25 variables, 50 variable then, 75 variables..
so would i be able to make something where i created something like
Variable 1
Variable 2
Variable #
and so on until i didn't need anymore, and then i could easily sort records, and i'd imagine the program would run faster overall. Although i really have no idea i'm more just curious whether it's possible.
Oh and sorry if this is hard to read i'm having trouble expressing my question.
![]() |
Similar Threads
- PHP Form Validation ??? (PHP)
- Arrays (Shell Scripting)
- Creating a Login Page (ASP)
- asp:repeater in a form? (ASP.NET)
- creating variables (C++)
- PHP E-mail setting ??? (PHP)
- image help (PHP)
- a little help (C++)
Other Threads in the C++ Forum
- Previous Thread: ebooks for c++ programming on linux
- Next Thread: graphics in c++
| Thread Tools | Search this Thread |
api array arrays based beginner binary c++ c/c++ calculator char char* class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news number numbertoword output parameter pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






