Thread: write Variable and open Variable and get Information

  1. #1
    Registered User
    Join Date
    Apr 2004
    Posts
    9

    write Variable and open Variable and get Information

    Dear People,

    Does somebody know how I can save my variable into
    a file in this case the variable is "buffer" with a recordnumber
    so I can get the next time the information with the recordnumber
    please make it posseble in this code:

    code:

    // C++

    #include <iostream.h>
    #include <string.h>
    #include <stdlib.h>

    void main()
    {
    char buffer[10];
    char b;

    cout << "\n\nType a word: " << endl;
    cout << "\n:";
    cin.getline(buffer, 10);

    if ( strcmp ( buffer, "hallo" ) == 0 )
    cout << "The typed word is the same as the embeded word in this program.\n\n";
    else
    cout << "The typed word is not the same as the embeded word in this program.\n\n";

    cout << "\nTyped word: " << buffer << endl;
    cout << "\n\nEnter to Exit.\n";

    cin.get(b);
    }


    thank you verry much


    greetz cyberbjorn

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    If you have questions on the same code, keep them to the same thread. There is little more irritating than answering a question and then going to the next thread to see the same code from the same person with a slightly different question.
    My best code is written with the delete key.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Agreed
    Replies go here
    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.

Popular pages Recent additions subscribe to a feed