Re: [Vala] const in Vala



Okay:

public static string getline() {
    const int bufferSize = 32;
    string @return = "", buffer;

    do
    {
        char[] temp = new char[bufferSize];
        stdin.gets(temp);
        buffer = (string)temp;
        @return += buffer;
    }
    while(buffer.length + 1 == bufferSize);

    return @return;
}

I'm using valac 0.5.1 on Windows.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]