Hey guys, I'm a newbie at C++ and I was wondering what is wrong with my code? I am trying to limit an integer in a struct to fit within a certain range (I know this code doesn't contain ranges as such, in the if statement) but I'm confused on what to do. I don't get an error when I compile the code I just get the number "12" as a cout in the console. What I'm looking for the program to do is utilise the if else statements instead of printing the bloody number! :(
[Edit] I know the cin.get() thing is a bad idea but I'm using Visual Studio 2013 and I heard it was a way to get the damn thing to compile without exiting straight away :)
That was a pain in the ass! Thank Guys!!!:D It's working!
You're both awesome, really good community here
ThisGuyIsBrad, just so you know I got this error but Aceix your one is the solution (Just incase you wanted to know:) ) : 1>------ Build started: Project: C++ Learning, Configuration: Debug Win32 ------
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(388,5): warning MSB8028: The intermediate directory (Debug\) contains files shared from another project (Project1.vcxproj). This can lead to incorrect clean and rebuild behavior.
1> Source.cpp
1>c:\users\windows 8\documents\visual studio 2013\projects\project1\project1\source.cpp(16): error C2039: 'indentifier' : is not a member of 'main::Strct_StudentRecords'
1> c:\users\windows 8\documents\visual studio 2013\projects\project1\project1\source.cpp(6) : see declaration of 'main::Strct_StudentRecords'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========