Using Visual C++ 6.0

Sid Kraft 21 Reputation points
2020-08-19T17:16:35.62+00:00

Using the c++ command gets(Data[Point].Comment); to input data from the keyboard and enter into a variable where the variable Comment is part of a structure. The program just ignores, no error or anything. Have the pre-defined library #include <stdio.h> where the command structure is supposed to be defined. When I look at the Comment variable in debug, the variable has been defined as 20 characters long and is empty, all blanks??? Any ideas, Sid Kraft

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,760 questions
{count} votes

1 answer

Sort by: Most helpful
  1. RLWA32 45,701 Reputation points
    2020-08-19T17:42:59.38+00:00

    Aside from the fact that VC++ 6.0 is long out of support and obsolete and there is no structure in its version of stdio.h that you describe -- did you remember that you must hit enter to terminate the keyboard input and that the gets function will happily overrun the buffer if too many characters are entered?

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.