write Variable and open Variable and get Information

This is a discussion on write Variable and open Variable and get Information within the C++ Programming forums, part of the General Programming Boards category; Dear People, Does somebody know how I can save my variable into a file in this case the variable is ...

  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,796
    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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,497
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21