R
RAGreatti
Ok, I just started programming and I need some help here. Anyone know
how to display the sum of numbers stored in a sequential access file?
So far I have the following text that I pulled from an example, and I
need to fill in the blanks and change all the wrongs. Let me know what
variables to declare if you can. Thanks in advance!!!
#using <mscorlib.dll>
using namespace System;
int main()
{
while (inFile->squares.txt() != -1)
{
record = inFile->ReadLine();
position = record->IndexOf("#", 0);
name = record->Substring(0, position);
sales = Convert::ToInt32(record->Substring(position + 1));
Console::WriteLine("{0}{1}", name->PadRight(15),
sum.ToString("N0")->PadLeft(10));
} //end while
//close the file
inFile->Close();
//end if
return 0;
} //end of main function
how to display the sum of numbers stored in a sequential access file?
So far I have the following text that I pulled from an example, and I
need to fill in the blanks and change all the wrongs. Let me know what
variables to declare if you can. Thanks in advance!!!
#using <mscorlib.dll>
using namespace System;
int main()
{
while (inFile->squares.txt() != -1)
{
record = inFile->ReadLine();
position = record->IndexOf("#", 0);
name = record->Substring(0, position);
sales = Convert::ToInt32(record->Substring(position + 1));
Console::WriteLine("{0}{1}", name->PadRight(15),
sum.ToString("N0")->PadLeft(10));
} //end while
//close the file
inFile->Close();
//end if
return 0;
} //end of main function