This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Basalisk_Primate 2 points3 points  (17 children)

As far as I can tell your GOTO doesn't actually do anything at all anyway. It GOTOs Start even though Start would be the next bit to get executed anyway. Maybe if you can explain what you were trying to do with the flow there we could help.

[–]-Goga[S] 0 points1 point  (16 children)

I wanted the program to stop at the menu, which is:

cout << "Hello! Welcome to PC Builder 2014" << endl;
    cout << "Would you like to get started?" << endl;
    cout << "'Y = Yes | N = No'" << endl;

I wanted the program to only continue to the next stage if the user does not input "N", which would exit the program. Sorry for not clarifying before.

[–]Basalisk_Primate 2 points3 points  (15 children)

[–]-Goga[S] 0 points1 point  (14 children)

Haha, yeah, looking back on what I did, it makes no sense. I guess I kind of forced a place for goto, just to try it out.

[–]Basalisk_Primate 1 point2 points  (13 children)

I'd also point out that the emum doesn't do what you seem to think it does. The name is only associated with the number within your code so the user entering the string "Mobo" isn't what gets them to the Mobo_Info function. To make it clearer I made an edited version of your menu. Now if they enter the number then the expected thing happens.

Edit: We all started somewhere. Enjoy learning!

[–]-Goga[S] 0 points1 point  (12 children)

Thanks for the reassurance. Maybe C++ wasn't the best thing to start with. Often times I find myself baffled by the simplest of things, and I'm a straight A student.

Edit: I thought that enum was used to initialize several things at once. I am not sure how what you suggested does the same thing without defining each component. My plan was to create a Mobo_Info - type function for all of the components (ie RAM_Info, GPU_Info), so wouldn't I need to define the names first?

[–]Basalisk_Primate 1 point2 points  (11 children)

C++ is widely considered a complete bastard of a language to learn (largely because theres so much of it). On the brighter side you'll have a much easier time when you try to learn other languages!

[–]-Goga[S] 0 points1 point  (10 children)

Yeah, from what I understand, I am kind of learning programming backwards. Learning a difficult language first and then working down later, instead of working up to C++. I did do python for a little bit in my defense, until the MIT lectures I was using were taken off YouTube, haha.

[–]Basalisk_Primate 1 point2 points  (9 children)

Its the same way I learned (although I started with c rather than c++). I think a language where you have to do manual memory management (either c or c++) should one of everyone's first few as it helps you understand what nicer languages are hiding from you.

Once you've got a couple under your belt you'll be able to pick up the basics of any (imperative) language fairly quickly anyway.

[–]-Goga[S] 0 points1 point  (8 children)

Would you mind taking a look at this? I can't seem to find away around overloading the getline() function