Ok, I am trying to learn other types of functions, because all I knew how to do was inline functions. Anyway, in the process of rewriting an app I made, I am having problems I don't understand at all.
Quote:
Originally Posted by Dev-C++ 5
Thank youCode:#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int loadfile(ifstream file);
int main ()
{
cout<<"Welcome to TodesRunes 1.1!"<<endl;
int iRun = 1; //menu choice
int iCubed = 0; //if the cubing function has been called
const int iNumOfRunes = 33;
int aiRunes1[iNumOfRunes] = {0};
int aiRunes2[iNumOfRunes] = {0};
const string sRuneNames[iNumOfRunes] = {"El", "Eld", "Tir", "Nef", "Eth", "Ith",
"Tal", "Ral", "Ort", "Thul", "Amn", "Sol",
"Shael", "Dol", "Hel", "Io", "Lum", "Ko",
"Fal", "Lem", "Pul", "Um", "Mal", "Ist",
"Gul", "Vex", "Ohm", "Lo", "Sur", "Ber",
"Jah", "Cham", "Zod"};
ifstream file; //ATMA dump
ofstream save; //TodesRune dump
loadfile(file); //loads the ATMA dump
}
int loadfile(ifstream file)
{
file.open("Runes.txt");
if (!file.is_open())
file.open( "runes.txt");
if (!file.is_open())
file.open( "rune.txt");
if (!file.is_open())
file.open( "Rune.txt");
if (!file.is_open())
while(!file.is_open())
{
string filename;
cout<<"TodesRunes could not find your ATMA dump,"<<endl
<<"please specify the path to the txt file."<<endl;
getline(cin,filename);
file.open(filename.c_str());
}
return 0;
}
~Wraith