White space is significant. Really.



  • Obviously, someone has decided the ?: operator reduces the clarity of their code.

    string::size_type loc = inFileName_.find("Info",0);
    if (loc != string::npos)
    {
        outFile << "XXX   " << xxxName_ << "      \n";
    }
    else
    {
        outFile << "XXX   " << xxxName_ << "           \n";
    }
    


  •  Care to explain a little more as to what this code was actually supposed to do? 



  • @Mole said:

     Care to explain a little more as to what this code was actually supposed to do? 

    Confuse people?



  • @OzPeter said:

    @Mole said:

     Care to explain a little more as to what this code was actually supposed to do? 

    Confuse people?


    its working




  • @Nelle said:

    @OzPeter said:
    @Mole said:

     Care to explain a little more as to what this code was actually supposed to do? 

    Confuse people?


    its working


    Sometimes you get a win!



  • You don't suppose for a moment it's documented why it's necessary to output 5 extra spaces? (it might be 6, it's a little hard to tell). All I can tell is that it's the first line in the output file.

    I think it's processed by another program. And if that program is actually dependent on the number of characters in the first line, god help us.

    There's a lot of this in the code as well:

        string out;
        out.clear();
        out.append("abcde ", 6);
        out.append(another c string);
        out.append(c++ string);
        outfile << out;
    


  • So you don't know what it's supposed to do.



  • Right, so remove those spaces, see if it still works and then get back to us :)



  • @spadgas said:

    You don't suppose for a moment it's documented why it's necessary to output 5 extra spaces? (it might be 6, it's a little hard to tell). All I can tell is that it's the first line in the output file. I *think* it's processed by another program. And if that program is actually dependent on the number of characters in the first line, god help us. There's a lot of this in the code as well:

     Writing a fortran program out to a punch card reader?


Log in to reply