How to Declare Character array with filepath?

This is a discussion on How to Declare Character array with filepath? within the C++ Programming forums, part of the General Programming Boards category; Hey all, I'm working on my intro to computing science lab, and the lab deals with "declaring a character array ...

  1. #1
    Registered User
    Join Date
    Apr 2010
    Posts
    22

    How to Declare Character array with filepath?

    Hey all, I'm working on my intro to computing science lab, and the lab deals with "declaring a character array and initilize it with the filepath where filepath is the location of the Cinderella.txt", how do I go about doing this? I have to input a file but the question is how? I have the Cinderella.txt saved on my desktop, so can anyone please explain to me the syntax? Please and thank you!

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Surely you've done declarations with initializations before, like
    Code:
    int a = 5;
    float b = 3.7f;
    char c = 'c';
    double d[4] = {1.5, 2.5, 7.5, 11.5};
    et cetera? So declare a char array, and initialize it with the location of your file.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Character Array comparison
    By magda3227 in forum C Programming
    Replies: 7
    Last Post: 07-09-2008, 08:36 AM
  2. Converting character array to integer array
    By quiet_forever in forum C++ Programming
    Replies: 5
    Last Post: 04-02-2007, 05:48 AM
  3. Quick question about SIGSEGV
    By Cikotic in forum C Programming
    Replies: 30
    Last Post: 07-01-2004, 07:48 PM
  4. Type and nontype parameters w/overloading
    By Mr_LJ in forum C++ Programming
    Replies: 3
    Last Post: 01-02-2004, 12:01 AM
  5. Character Array - almost? works
    By voltson4 in forum C Programming
    Replies: 3
    Last Post: 03-04-2003, 05:03 PM

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