Thread: the delete key word...

  1. #1
    Registered User Finchie_88's Avatar
    Join Date
    Aug 2004
    Posts
    154

    Question the delete key word...

    hi, just wondering about the "delete" keyword, what is the syntax for this command, and is there a way that it can be used with varibles, for example, you could delete a varible, or text which is already on the screen, hence clear the screen???

    Is there any1 out there who can help???


  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Take a look at cprogramming.com's own FAQ on the topic
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User Finchie_88's Avatar
    Join Date
    Aug 2004
    Posts
    154
    yer, thats answers 1 of my questions, but is there a way that that could be used to delete a previously printed message on the screen. The way it is, that can delete varibles, but can it be used as a method of clearing the screen???

    But thanks anyway, that does help me a lot...

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >but is there a way that that could be used to delete a previously printed message on the screen
    Um...no. delete is used to release memory allocated with new. That's a totally different operation than redrawing pixels on your monitor. If you really need to clear the screen (I don't see much use for it) then you can check the FAQ entry for a few suggestions.
    My best code is written with the delete key.

  5. #5
    you could use printf("\b");
    after you print something such as
    Code:
    cout << "My words!"; \\Says words
    getch(); \\Pauses the screen till you hit a key (requries <conio.h>)
    printf("\b");\\does backspace to the screen

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. please help with binary tree, urgent.
    By slickestting in forum C Programming
    Replies: 2
    Last Post: 07-22-2007, 07:55 PM
  2. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 05:49 PM
  3. Virtual keys
    By Arkanos in forum Windows Programming
    Replies: 4
    Last Post: 12-12-2005, 10:00 AM
  4. Problem need help
    By Srpurdy in forum C++ Programming
    Replies: 1
    Last Post: 07-24-2002, 12:45 PM
  5. memory management...
    By master5001 in forum Game Programming
    Replies: 24
    Last Post: 01-07-2002, 05:50 PM