Hello elitepvpers !

02/10/2011 18:36 gianfranco ramoser#1
Hello,

I'm a programmer, and i'm intersted in network programming.

I find socket in C quite difficult !

Best regards,

Gianfranco Ramoser
02/11/2011 00:07 Bаne#2
Ok, well we could use a bit more discription lol...

Ever need some help in C++ codeing we have a very nice section of our forums to help you out too!!
02/11/2011 02:31 .Ash#3
Welcome to ePvp.

Hey can you teach me inipath? i got some of it down, but cant.. This is for dev c++, i will turn it into visual studio sometime later..

Code:
/* File config.txt:
num = 123
str = hello
flt = 12.2
*/
 
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
using namespace std;
 
struct Config {
    int    num;
    string str;
    double flt;
};
 
void loadConfig(Config& config) {
    ifstream fin("config.txt");
    string line;
    while (getline(fin, line)) {
        istringstream sin(line.substr(line.find("=") + 1));
        if (line.find("num") != -1)
            sin >> config.num;
        else if (line.find("str") != -1)
            sin >> config.str;
        else if (line.find("flt") != -1)
            sin >> config.flt;
    }
}
 
int main() {
    Config config;
    loadConfig(config);
    cout << config.num << '\n';
    cout << config.str << '\n';
    cout << config.flt << '\n';
}



// Wtf o.o return 0;
02/11/2011 06:19 ~>Bl4Ck<~#4
welcome to epvp
02/11/2011 14:00 xZanx#5
welcome to epvp
02/12/2011 04:44 Taec#6
Welcome to EPvp, love programmers :D
02/14/2011 09:10 VastoStyles.#7
Welcome,
I think programmers are always welcome XD
02/15/2011 07:56 .eXecution#8
welcome
02/15/2011 11:57 kristokas#9
Welcome to EPvp
02/15/2011 14:27 Aparello#10
hello and welcome :)