Archived

This topic is now archived and is closed to further replies.

.NET more like .WTF

This topic is 4945 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok i started playing with .NET the other day, using C++. So i tried to make a simple console application that prints to the screen... yep fine... When it comes to i/o however... how the hell do you open a file in this bs piece of software? the old libraries don''t seem to work at all!?

Share this post


Link to post
Share on other sites
Put all of your includes in stdafx.h

Also, put #include <iostream> without the .h at the end.

.NET is the politically correct C++ so you also gotta use the
using namespace std; on top as well

Share this post


Link to post
Share on other sites
Using the std namespace has nothing to do with .NET, it's because everything in iostream is declared in that namespace As well as everything else in the standard headers.

Using managed extensions means using the .NET Framework. There's nothing wrong with .NET, you just have to get used with that's happening first And explore the framework a bit. I think you'll find everything you need in the File and FileStream classes. And more!



[edited by - Zipster on May 28, 2004 1:40:54 AM]

Share this post


Link to post
Share on other sites
1) This thread should be closed immediately before it turns into a flamebait due to the topic title.

2) Topic titles should be descriptive of the questions you have.

edit: nevermind on #3

4) Check msdn.microsoft.com. It's a wonderful wealth of information, as long as you know how to use a search feature. There's also the help files that come with VS.NET which are actually useful. I'm not going to look this up, as I would rather teach you how to fish in the great sea of search engines, thus "feeding you for a lifetime", rather than giving you a fish and "feeding you for a day".

5) remove "hell" "bs" and "!?"... by doing this early, you have a better chance of attracting venture capitalists with your superior writing skills.

6) remove "god" and "I just want". The first will get someone started on the pledge of allegience controvercy, and the second sounds whiny. Replace with "dang" and "I prefer" prehaps. Again, venture capitalists. They're crazy about this kind of thing.

[edited by - MaulingMonkey on May 28, 2004 7:05:11 AM]

Share this post


Link to post
Share on other sites
ok....

Well, I assume you use Visual Studio.NET, and not Managed C++. You are suppose to use the ANSI C++, thus for the STL libraries such as cout, cin, you need to use iostream, instead of iostream.h. As for standard file I/O, do you mean C++ style(fstream) or C style(FILE *). fstream classes can be found in .

Toolmaker



My site
/* -Earth is 98% full. Please delete anybody you can.*/

Share this post


Link to post
Share on other sites
quote:
Original post by Muncher
god... i just want to use the old file io functions.....




#include <cstdio>
using namespace std;


[edited by - MDI on May 28, 2004 3:02:56 PM]

Share this post


Link to post
Share on other sites

This topic is 4945 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.