I think I changed some configurations on my Visual Studio Ultimate 2013 now I get this error message everytime I compile something
I think I changed some configurations on my Visual Studio Ultimate 2013 now I get this error message everytime I compile something
There is nothing wrong with Visual Studio. This is what it looks like when your code crashes. You have a bug somewhere.
If you bother to look in the window, you'll see it's pointing to the call to scanf_s(). Probably a buffer overflow.
Code://try //{ if (a) do { f( b); } while(1); else do { f(!b); } while(1); //}
Just because your code compiles, does not mean it has no bugs.
The screenshot you posted clearly shows an application crash, with the debugger stopped at a specific line of code. If you don't understand what you are looking at, we can help explain it to you. But if you don't believe me, I'm not sure how I can help.
Code://try //{ if (a) do { f( b); } while(1); else do { f(!b); } while(1); //}
I agree with brewbuck -- I can only just make out the error -- but I can certainly spot the words "memory violation"! The problem with memory corruption is that it bites at unexpected times. Just be glad your debugger yelled at you -- it's a lot hard to track these things down in the wild.
I think (sorry, I'm on Linux today) that there is an "exceptions" dialog box you can get at in VS (think it's under the debug menu). My memory is a little hazy but I seem to remember that if you turn off exception catching then it's a lot easier to see what's gone wrong.
But in the interests of being fair -- what exactly do you think you did to screw up your debugger? If you've been messing with the property settings, it may be worth starting a new project and copying your source over..... but I'd bet that the same thing would happen again.
Your problem is that you use scanf_s like scanf, but scanf_s needs additional parameter.
If you use special functions from Microsoft you should know this.
Look: https://msdn.microsoft.com/en-us/library/w40768et.aspx
Originally Posted by Microsoft
Other have classes, we are class
I only have VS2010 in front of me here, it may have moved slightly in 2013. Go to the Debug menu and choose "Exceptions..." A dialog will appear showing a tree view. Open the entry labeled "Win32 Exceptions." There will be a bunch of different codes listed. The easiest thing is to just turn on all of them. The specific type of exception in OP's example is 0xC0000005, so in theory you could just check that one.
Forgetting that, I don't bother with those and just click the "Break" button when the crash dialog appears. That puts you in the debugger.
The code is probably displaying undefined behavior. If you change a compiler setting (for instance, optimization level, CRT version, etc) who knows what will happen.But in the interests of being fair -- what exactly do you think you did to screw up your debugger? If you've been messing with the property settings, it may be worth starting a new project and copying your source over..... but I'd bet that the same thing would happen again.
Code://try //{ if (a) do { f( b); } while(1); else do { f(!b); } while(1); //}
If you want to learn C then just continue learning C.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
No, C and C++ are different. Yes, C++ has deliberate native support for object oriented programming techniques.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)