Thread: Problem with strings in Turbo C

  1. #16
    Join Date
    Oct 2007
    Inside my computer
    Quote Originally Posted by Elkvis View Post
    those would be great if this were C, but this is C++, so it should be more like this:
    char* word = new char[100];
    cin >> word;
    delete[] word;
    This is prone to buffer overflows. Use std::getline or simply std::string.
    Same applies for arrays on the stack.

    In any case, if the teacher forces you to use Turbo C(++) and void main and other non-standard crap, then I think it is a good idea to drop the course, unless it's a requirement.
    Learning outdated tools will not help you in real life in any way or form.
    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.

  2. #17
    Registered User
    Join Date
    Oct 2006
    Quote Originally Posted by Elysia View Post
    definitely, but the point was to demonstrate the C++ way of doing what CommonTater was demonstrating.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Graphics problem in turbo c++
    By mushahidh in forum Game Programming
    Replies: 1
    Last Post: 10-31-2010, 08:22 AM
  2. Turbo C++, Convertion problem
    By paulroseby in forum C Programming
    Replies: 4
    Last Post: 05-08-2003, 04:23 PM
  3. I have a problem with turbo c++ v3.0
    By leeng_viper in forum C Programming
    Replies: 1
    Last Post: 12-22-2002, 02:16 PM
  4. Replies: 0
    Last Post: 09-25-2002, 04:34 AM