Good day
I am just starting to learn C++ and I have decided to go with my first project. It is as follow:
Pierre 39 Canada
Nathalie 32 United Sates
Lee 31 Japan
By writing the first name the program would get the age and country. I got the windows on the screen plus three boxes but it is as far as I go. I know this was the easy part but I am working on it.
I know about dentistry and some electronics but no so little about C++. That would be really appreciated if someone could get me on the right path.
P.S. I work with Visual 2005 and the language seems different from older version. I should maybe by the the C++ Bible 2005?
Difficulties with a simple application
Started by
Guest_Viper_*
, Jul 03 2006 10:34 AM
21 replies to this topic
#1
Guest_Viper_*
Posted 03 July 2006 - 10:34 AM
Guest_Viper_*
|
|
|
#2
Guest_Jordan_*
Posted 03 July 2006 - 02:23 PM
Guest_Jordan_*
I wouldn't buy the bible as you are using .NET 2.0 it sounds like. It is a little different than ANSI C++.
Can you post your code? Is this a console project or a windows form project?
Can you post your code? Is this a console project or a windows form project?
#3
Posted 03 July 2006 - 05:29 PM
So basically when you type a name you want the other two values to appear in seperate boxes?
Once the user types the name do they press a button of any kind?
Once the user types the name do they press a button of any kind?
Void
#4
Guest_Viper_*
Posted 03 July 2006 - 05:44 PM
Guest_Viper_*
Jordan
It's a windows form project indeed. The code so far is only what C++ did already. Like Visual Basic, by using the tool bar, it's only a drag and drop thing. It's getting busy at work with people on vacation but I will gave you what I have for code this week.
Void
I forgot about the button. Yes, once a user have type the first name then press an "OK" button the two values will appear in the two boxes.
I feel like making my first step at 10 months old.
It's a windows form project indeed. The code so far is only what C++ did already. Like Visual Basic, by using the tool bar, it's only a drag and drop thing. It's getting busy at work with people on vacation but I will gave you what I have for code this week.
Void
I forgot about the button. Yes, once a user have type the first name then press an "OK" button the two values will appear in the two boxes.
I feel like making my first step at 10 months old.
#5
Guest_Jordan_*
Posted 03 July 2006 - 05:52 PM
Guest_Jordan_*
Viper said:
I feel like making my first step at 10 months old.
I bet. How are you going to read what the name matches up to. Do you have a list of names in the text file or do you have them in a database?
Once the user presses the button you could have some code like this:
if (String::Compare(textBox1->Text,"Pierre") == 0) {
textBox2->Text = "39";
textBox3->Text = "Canada";
}
Of course all this would be hard-coded and not a good idea unless you are just messing around. You would need something like a database to match the first name with the other values you need.
#6
Guest_Viper_*
Posted 03 July 2006 - 06:47 PM
Guest_Viper_*
I like the coding Jordan. Thank you
I could make a database right in a txt file. I am just using the three first name for database. That would be better then having more lines in the programming.
Long weekend is over back to work tomorrow.
I could make a database right in a txt file. I am just using the three first name for database. That would be better then having more lines in the programming.
Long weekend is over back to work tomorrow.
#7
Posted 09 July 2006 - 03:52 PM
Hey Viper,
A text file would work perfect for this. Have you gotten the code to work for this yet?
A text file would work perfect for this. Have you gotten the code to work for this yet?
#8
Guest_Viper_*
Posted 10 July 2006 - 03:46 PM
Guest_Viper_*
Not yet Crane. I start my vacation this friday so I can work on it. Til then, I do some reading in C++. It seems that VB would be easier to do what I want but I'm sticking with C++.
I do intend to learn and eventually help other one day.
I do intend to learn and eventually help other one day.
#9
Posted 10 July 2006 - 04:00 PM
One thing I've noticed, Viper, is that you seem to be focused on how to get the information, but not how you're going to store it internally. You can use a map<> to store the information in RAM and make retrieving the data a simple call. You can have everything except for the display figured out pretty easily, and save that for last. It's easier to make the interface once everything else is working than to keep changing the interface to reflect the internal changes you are making.
#10
Guest_Viper_*
Posted 21 July 2006 - 04:46 PM
Guest_Viper_*
I made an MS Access database .mdb and use MVC++ 2005 to retrieve the data but didn't work. I read that it was possible.
I wonder what a programmer would go: Arrays or .mdb? I am on a stop. Should I go learn more about arrays and go from there?
I should post it in the Managed C++. Sorry
I wonder what a programmer would go: Arrays or .mdb? I am on a stop. Should I go learn more about arrays and go from there?
I should post it in the Managed C++. Sorry
#11
Posted 21 July 2006 - 06:33 PM
Viper, if you really want to learn c++ , stick to the general basics. Learn to use arrays properly and to their full advantages, and if your looking at databases looking up how hash tables work will be a bonus.
#12
Guest_Jordan_*
Posted 22 July 2006 - 12:21 AM
Guest_Jordan_*
Both will do you justice. It is very possible to retrieve data from MS Access using VC++ 2005.
Personally, I would go database but not access.
Personally, I would go database but not access.


Sign In
Create Account

Back to top










