Thread: Fix microsoft visual studio ver 2015

  1. #1
    Registered User
    Join Date
    Aug 2016
    Posts
    1

    Fix microsoft visual studio ver 2015

    I have problem with my Microsoft Visual Studio ver 2015. I write the code but when i click to LOCAL WINDOWS DEBUGGER, i receive this Fix microsoft visual studio ver 2015-untitled-jpg
    I hope pro C++ programmer help me to fix it because next week i have to pay this exercise to my teacher...thanks so much!!!

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    1. Stop using fflush(stdin) to clean up the input buffer. Aside from the fact that it's undefined behaviour, stdin is a C stream, not a C++ stream (ie, the stream used by >>).
    FAQ > Why fflush(stdin) is wrong - Cprogramming.com

    If you want to clean up the C++ input stream upto the next newline, then use cin.ignore(), see here for usage:
    http://stackoverflow.com/questions/2...t-recognize-it


    2. STOP using gets()
    FAQ > Why gets() is bad / Buffer Overflows - Cprogramming.com
    Read your compiler error messages, it's telling you that gets() is not found.

    You should be using cin.getline to read a whole line of input in C++.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Salem View Post
    You should be using cin.getline to read a whole line of input in C++.
    You should be using std::getline to read a whole line of input in C++.

    As for the error message, it's because your program did not compile correctly, so there's no executable created that can be run. I'd recommend you to relearn C++ properly using a good book such as Accelerated C++.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Visual Studio 2015 errors
    By adamthing in forum Windows Programming
    Replies: 3
    Last Post: 04-20-2016, 11:31 AM
  2. Can't code in C on Visual studio 2015 :(
    By The coder in forum C Programming
    Replies: 2
    Last Post: 12-18-2015, 07:10 AM
  3. Visual Studio 2015 CPU Usage Profiling Not Working?
    By BobLoblaw465634 in forum C++ Programming
    Replies: 2
    Last Post: 08-12-2015, 09:46 PM
  4. Replies: 1
    Last Post: 08-08-2015, 01:02 PM
  5. Microsoft Visual Studio .NET HELP!!
    By mrafcho001 in forum Tech Board
    Replies: 8
    Last Post: 03-15-2005, 02:16 PM

Tags for this Thread