In the next code, we used "%s" format with receiving an integer value, while from C experience, we know that we use "%d" or "%i" formats, so what "%s" stands for here, I guess it's for receiving string data type?

import std.stdio;

    void main() {
        write("How many students are there? ");

        /* The definition of the variable that will be used to
         * store the information that is read from the input. */
        int studentCount;

        // Storing the input data to that variable
        readf("%s", &studentCount);

        writeln("Got it: There are ", studentCount, " students.");
    }

Reply via email to