Search:

Type: Posts; User: cpluspluser

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    1,530

    writing char arrays to a file

    I've got 2 char arrays as follows:

    password[80];

    message[80];


    I want to write them to a file ONE AT A TIME. First the password onto the 1st line of the file. Then the message onto the...
  2. Replies
    4
    Views
    890

    ...

    I know I'm using getline(), but I can't seem to use it for 2 lines. I can get the first line no prob

    e.g. infile.getline(variable, 80, '\n')


    But how do I use getline() to get the second...
  3. Replies
    4
    Views
    890

    Reading with getline()..STILL NEED HELP =(

    Hi, all:

    I have the following 2 lines in a file:

    password
    Another sample line.


    I want to first read in the first line (i.e. password) and write it to a file. Then I want to go back and...
  4. Replies
    4
    Views
    1,919

    Reading multiple lines from a file

    Hi, all!

    I'm writing an encryption program where I want to encrypt 2 lines that are being read in from a file. First I want to encrypt the 1st line and write the encrypted version to a second...
  5. Replies
    2
    Views
    1,787

    Parameter in a function

    The "combination" is defined as char combination[6]. When newCombination is called, I want the parameter c string (combo) to be set to the combination variable, if the entire combo string is...
  6. Replies
    1
    Views
    1,035

    Referring to a C String

    If I've got the C String:

    char c_string[15];

    Can I refer to it later as:

    c_string

    or does it need to be c_string[]
  7. Replies
    3
    Views
    15,893

    Initializing a C String

    As much as I've read on this one issue, it still confuses the heck out of me.

    If I've got a C String as follows:

    char testString[6];

    Can this be initialized as follows:

    testString =...
  8. Replies
    1
    Views
    1,481

    Function calls

    Good Evening!

    Having some trouble getting the folowing program to function properly. It compiles perfectly, but does not seem to be functioning. Essentially, the code is supposed to create a...
  9. Simple function that's supposed to write to a file - doesn't work

    Here's a simple function that's supposed to write to a file (random access file), but it doesn't seem to work. Any ideas why?

    Thanks!!



    void addRecord(fstream& file)
    {
    InventoryItem...
Results 1 to 9 of 11