User Profile

Collapse

Profile Sidebar

Collapse
pb1uk
pb1uk
Last Activity: Sep 3 '06, 04:28 PM
Joined: Aug 26 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • pb1uk
    started a topic reading strings into more than 1 array with if
    in C

    reading strings into more than 1 array with if

    hello, i need to read in commands from a text file. Once the first line is read into an array if it is a certain word then a certain amount of numbers are read into another array. i have been using

    filein>>array[size];
    if(command =="MOVETO")
    { filein>>value1[];
    filein>>value2[];
    }
    etc

    it doesnt seem to want to work and the compiler does like my use of ==...
    See more | Go to post

  • pb1uk
    replied to Reading commands into an array from a text file
    in C
    command is type string as is the array:

    string command;
    string patternarray[100];
    See more | Go to post

    Leave a comment:


  • pb1uk
    replied to Reading commands into an array from a text file
    in C
    Hello,
    the below is a segment of code from my program and is part of a switch statement case1:

    cout <<"Enter the name of the pattern file you wish to load: " << endl;
    cin >> patternfile;
    filein.open(pat ternfile.c_str( ));
    if(filein.good( ))
    {
    filein>>firstwo rd;
    while (firstword =="PATTERN")
    {
    filein>>pattern array[command];...
    See more | Go to post

    Leave a comment:


  • pb1uk
    replied to Reading commands into an array from a text file
    in C
    Hello,
    the below is a segment of code from my program and is part of a switch statement case1:

    cout <<"Enter the name of the pattern file you wish to load: " << endl;
    cin >> patternfile;
    filein.open(pat ternfile.c_str( ));
    if(filein.good( ))
    {
    filein>>firstwo rd;
    while (firstword =="PATTERN")
    {
    filein>>pattern array[command];...
    See more | Go to post

    Leave a comment:


  • pb1uk
    started a topic Reading commands into an array from a text file
    in C

    Reading commands into an array from a text file

    Hello,
    I need to read in commands from a text file into an array and i just can't do it. I am trying to use the line filein>>pattern array[command];
    and it doesn't work! can anyone help me?

    Cheers
    See more | Go to post
No activity results to display
Show More
Working...