本文整理汇总了C++中FileIO::GetFileContents方法的典型用法代码示例。如果您正苦于以下问题:C++ FileIO::GetFileContents方法的具体用法?C++ FileIO::GetFileContents怎么用?C++ FileIO::GetFileContents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileIO
的用法示例。
在下文中一共展示了FileIO::GetFileContents方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main() {
Couting couting;
FileIO file;
string text = file.GetFileContents("staff_ghost_time.bin");
if (text.size()==0) {
cout << "Fggt" << endl;
return 0;
}
else {
//Separating string to signs to reverse it
string array[160];
for (int a=0; a<160; a++) {
array[a]=text.substr(a, 1);
}
string convertedarray[40];
int array2[40][4];
long long finalarray[40];
for (int i=0; i<40; i++) {
//Reversing value and final string
convertedarray[i] = array[i*4+3] + array[i*4+2] + array [i*4+1] + array [i*4];
for (int f=0; f<4; f++) {
//String into int
array2[i][f]=convertedarray[i][f];
//If string was bigger than 127, give it a value to 255;
if (array2[i][f]<0) {
array2[i][f]=array2[i][f]+256;
}
}
//Final time value
finalarray[i] = array2[i][3]+array2[i][2]*256+array2[i][1]*65536;
}
cout << "Staff_Ghost_Time.bin editor by Szymbar15, 2014\nCreated for DSHack.org community\[email protected]\n*****************\nVersion 1.2\nDo you want to see some hints on tool usage? \nType \"y\" if you want or anything else if you don\'t: ";
char c;
cin >> c;
if (c == 'y') {
couting.CourseList();
}
int y;
while (y != 41) {
cout << "\n*****************\nWrite a number from 1 to 40 to load your desired course \nor write 41 to save changes and finish program: ";
cin >> y;
if (y <= 40) {
cout << "\nThe current value for this track is: \n"
<< finalarray[y-1] << " miliseconds, "
<< finalarray[y-1]/1000 <<
" seconds.\nWrite new value in miliseconds smaller than 16777216: ";
cin >> finalarray[y-1];
cout << "\nSuccesfully changed!\nYour new value is: "
<< finalarray[y-1] << " miliseconds, " << finalarray[y-1]/1000 << " seconds.\n\n";
}
else if (y > 41) {
cout << "\nWrong number.\n";
}
}