Oh well, thanks for clearing it up Sven.
Discussions
-
-
@magicalclick, I've tried Read() and it gets a single char, the problem with this and the ReadBlock() approach is that I actually don't know the length of each number and they could differ in length. I could certainly just read the entire line and the break it up using space but that wouldn't be as elegant as the C++ solution.
-
@kettch, your method is basically how I've been doing it but it requires more code to separate the string into the numbers I want and put them into the correct spot in the 2D array.
@cbae, in my case space is the delimiter. A delimiter is just some separator of data.
It's a txt file, an example would be like so:
2 11 3 10
1 9 4 6
6 13 7 8
5 14 15 12So what I want is to read int by int and put each number into my 2-dimensional array. I guess it boils
down to if I can do something like this in C#:
inFile >> someInt; // for ints seperate by space -
I'm kind of new to C# (come from a C++ background), and I've got a question regarding file reading. Is there a way to read a large number of ints or doubles from a file directly (as easy as in C++)?
I've looked into StreamReader, StringReader and BinaryReader and while I can get it done, I think I must be missing something since it's not nearly as straightforward as it is in C++. So far I've used StreamReader to read the entire file, then use ' ' as a delimiter and get my ints that way.
Basically I'm looking to do the C# equivalent of this:
std::ifstream ins; ins.open(file_name.c_str()); if(ins.is_open()) { while(ins) { ins >> tmp; arr[iter] = tmp; iter++; } } -
Maybe MS should buy HP's PC division. Maintain the same Windows philosophy but lead the way with hardware made to show off all the things the OS has to offer.
-
Steven Sinofsky addressed developer frustration and confusion about HTML5 vs Silverlight strategy
Aug 15, 2011 at 5:57 PMHe does have a point, there's no point in saying what Windows 8 will be if they're not sure they can deliver. It did happen with Vista and a lot of people were disappointed. It's better to see things once they're implemented any ways.
-
Great, I like quite a number of new features including lambdas, auto keyword, threading libraries, etc.. C++ feels modern again.
Now if only Windows 8 has good support for it

-
14 minutes ago, magicalclick wrote
*snip*
I would answer. I would put a wrapper around standard library and call it awsome VectorEx

lol, I'm going to give that one a try on one of my interviews.
-
2 days ago, BitFlipper wrote
I know some people might think this is a good idea and feel all warm and fuzzy about it, but this could have a negative impact. MS spent a ton of money developing this, with the idea that they can make this up with game sales. If people only buy the hardware, then they can't make up the R&D costs. Which makes it a non-profitable product.
So then they will have to raise the price, cancel the product, sell it only in bundles, and likely they won't develop a Kinect 2.0. None of those are good for Kinect's future.
Personally I think MS has a right to protect their investment and hope they figure out a way to prevent such unintended uses.
But how do these people buying only hardware negatively impact those that want to buy the hardware and software? I don't see this negatively affecting MS and Kinect. Seems to me, these people weren't going to use for gaming either way, so now they're simply buying the hardware which still makes MS money.
Interesting to see a Google engineer helping MS with Kinect.
-
spivonious said:
I'd love to work there. Windows division or some game.
Same here. I really like their games with managed code movement with XNA. OS programming is the next most interesting thing.