thanks,
i'm now trying to make a configuration file just like with my build script but than in c++ just to practise.
i'm now struggeling that i can't put letters in a variable. with the server description part if i now put letters in it, it says 0 in the settings.ini.
if you want to look in the "source" this is it:
i'm now trying to make a configuration file just like with my build script but than in c++ just to practise.
i'm now struggeling that i can't put letters in a variable. with the server description part if i now put letters in it, it says 0 in the settings.ini.
if you want to look in the "source" this is it:
Code:
#include <iostream>
#include <fstream>
using namespace std;
//the remove part
int Remove()
{
if( remove( "Settings.ini" ) != 0 )
perror( "Error deleting file" );
else
puts( "File successfully deleted" );
return 0;
}
//the server configuration
int main()
{
int Port;
int MaxPlayers;
int Description;
cout << "Please Enter your server port (default minecraft is 25565): ";
cin >> Port;
cout << "Please enter the maxplayers able to join: ";
cin >> MaxPlayers;
cout << "Please enter your server description: ";
cin >> Description;
ofstream myfile;
myfile.open ("settings.ini");
myfile << "[Server]\n" << "port=" << Port << "\nmaxplayers=" << MaxPlayers << "\nDescription=" << Description;
myfile.close();
return 0;
}