Who knows the freopen and scanf function functionality but in c# not in c???????
thanks
Who knows the freopen and scanf function functionality but in c# not in c???????
thanks
freopen
does not have a direct parallel. You'd have to Close
and then re-create a FileStream
object to get similar behavior.
scanf
and similar type-unsafe functions have been replaced with Parse
methods, e.g., int.Parse
. Your stdin
stream is Console.In
. You'll have to do your own delimiting from the input stream into a string, which can then be parsed into an integer.
I doit like this, as you say:
StreamReader objReader = new StreamReader("input.txt");
String readed = "";
while(readed != null){
readed = objReader.ReadLine();
System.out.println(readed);
}
using StreamReader then I can split it with ' ' to take each variable (in c will be scanf("%d%d%d",&v1,&v2,&v3))
thanks