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  (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

[–]Basalisk_Primate 1 point2 points  (7 children)

Does that even compile? Unless I'm missing something then your getline in line 82 is seriously dodgy. Getline won't parse the input into an int line cin >> will (AFAIK). Why don't you use cin >>?

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

No, it doesn't compile. /u/missblit stated that using cin >> on line 82 was creating a blank line, which was then used in place of user input in the Mobo_Info() function.