titanandrews
Programmer
Hi,
I have a program which reads all the lines of a C++ source file into an array, like this:
Then I display the lines to the console like this:
The problem is that somewhere I am getting double spaces on all the lines that contain spaces in front of the line. For example, if this were the C++ file I am reading.
The display on the console will look like this:
Notice the extra 4 spaces. This is double what I originally had. Does anyone know what is causing this, and how to correct it?
many thanks,
Barry
I have a program which reads all the lines of a C++ source file into an array, like this:
Code:
@lines = <MY_CPP_FILE>;
Code:
foreach(@lines)
{
print $_;
}
The problem is that somewhere I am getting double spaces on all the lines that contain spaces in front of the line. For example, if this were the C++ file I am reading.
Code:
bool MyClass::isTrue()
{
return true;
}
The display on the console will look like this:
Code:
bool MyClass::isTrue()
{
return true;
}
Notice the extra 4 spaces. This is double what I originally had. Does anyone know what is causing this, and how to correct it?
many thanks,
Barry