Advertisement Jump to content
  • Advertisement

Nervo

Member
  • Content Count

    4679
  • Joined

  • Last visited

Community Reputation

344 Neutral

About Nervo

  • Rank
    Banned
  1. Chris's method should be fine and I'd also like to add another method that you can consider too: const char* name = "Chris"; fstream f("test.txt", ios::out); f << name; you can easily use the insertion operator just like you do with std::cout for various data types. Its very flexible too. You can use ints, double's etc char*, strings and so on. Generally, I would use this method when I'm dealing primarily with text file operations. When I use binary files, I use the write() member function to write data off to the file, such as data.bin. here is some simple source I whipped: #include <fstream> #include <string> #include <iostream> using std::string; using std::fstream; using std::cout; int main() { int x = 5; string s; fstream outfile("file1.txt",fstream::out); // construct the outfile object outfile << "This is a test " << x; outfile.close(); outfile.open("file1.txt",fstream::in); //use the same object to reopen the file, or any other file for that matter while(!outfile.eof()) { outfile >> s; cout << s << " "; } getchar(); //to avoid output flashing away before your eyes when in console mode outfile.clear(); //reset any error state from the stream, trivial use here outfile.close(); return 0; } Lastly, this is just a basic method of using the fstream class. Should you want to learn a little bit more, I recommend reading the tutorial from this site: Fstream tutorial.
  2. ...Dunno, sounds like a hardware problem to me.
  3. Nervo

    Fear my simulated paint! Update: Client

    <p align =center>
  4. WM_MOUSEMOVE will only fire when there are actual mouse movements, and should have nothing to do with clicks. You can however, find out if a mouse button was pressed when the WM_MOUSEMOVE event was fired because it will have been passed into wParam. If you wanted to find out if a mouse button is pressed, for instance the left mouse button, then trap this event: WM_LBUTTONDOWN lParam will contain the x and y positions of the pointer when the event was fired if you need to know this. If you have further questions feel free to ask. EDIT: Whoops, it seems you realized it already.
  5. Quote:Original post by glVertex3f I tried WS_OVERLAP | WM_MINIMIZEBOX but there were no buttons there at all. Hmm, looking at some of my recent code, when I specified WS_SYSMENU in addition to the other two, it worked fine. Try that, and if I find something else I'll post again.
  6. Hello. For question 1 try doing a bitwise 'OR' combination of: WS_OVERLAPPED and WS_MINIMIZEBOX in CreateWindow() as the third argument. If I get time I'll try to address question 2 soon. EDIT: looking over the second part, I'm a bit confused as to what you are trying to accomplish. Your code is trapping the mousemove message but you seem to be asking about detecting mouse clicks. Perhaps I'm not understanding you correctly.
  7. Nervo

    Worst Metallica song

    Not trying to be facetious, but IMHO, anything they made from 1995 onward was never good. Only one minor exception being the hit song from 'Load' I think it was in 1995, 'until it sleeps'...I like that song. All the rest I was not partial too. In high school my freshman year, the black album had been out for about 1 or 2 years and even some people back then thought metallica was 'wussing' out. I liked the album nonetheless, but you can't deny: "Master of Puppets", "Ride the Lightning", "And Justicle for All", "Kill 'em All", "Garage Days Re-revisited" used to represent the essence of the band...(I hope I didn't miss any other albums from back then) ;)
  8. Nervo

    GMail's Ads Don't Get in the Way!

    Quote:Original post by Raduprv Quote:Original post by Nervo Wait...I have an idea...see if you can get a static ip and then run your own mailserver! w00t...plus domain name registration, lest you have people email you at blah@xxx.xxx.xxx.xxx Not a good idea. Yahoo has a VERY good spam protection, so if you get 300 viruses/day they won't kill all your bandwidth. I run my own mailserver and I get maybe one or two pieces of spam per week. Thats because I only use it for correspondence with people I know. I use yahoo and hotmail for signing up for accounts online where I know that I'll end up getting spam as a result of those signups. Mailservers are great because you can cache as many emails as you want and be able to configure the server as you see fit. Truthfully though, its not very cost effective as opposed to paying 10-20 dollars a year for a large space of mail storage from a reputable company, because my static ip alone is an additional 10 dollars per month. Though, the feeling of more control is priceless. :)
  9. Nervo

    GMail's Ads Don't Get in the Way!

    Wait...I have an idea...see if you can get a static ip and then run your own mailserver! w00t...plus domain name registration, lest you have people email you at blah@xxx.xxx.xxx.xxx
  10. Nervo

    Where can I find free books?

    What type of free books are you looking for exactly? The ones written solely for free distribution, or pirated copies of ebooks? If the latter, I believe the moderators here can really provide you with a concise answer on that one.
  11. Nervo

    So now I've spent a night in jail

    Quote:Original post by Tron3k I actually think it would be an interesting experience to be in jail for a day. I mean, you have NO responsibilities at all, you get free food ... mmmhmm, yeah you sell it so well. The biggest responsibility one might have is to try and leave jail without being beat up maybe? But what you can do is get yourself thrown in jail and report back here stating all the 'responsibilities' you had while there, including whether or not you had to guard your rear orifice from intrusion.
  12. Nervo

    STL list indexes

    I'm afraid that you will have to iterate through the list. Its the price you pay for the benefits it offers.
  13. Nervo

    Trouble with Win32 API

    I really recommend giving this well written article a good read-through in addition to any specific help you receive in this thread: Win32 Wrapper Class Hope that helps you out.
  14. Nervo

    c++ syntax

    Hello. ": empire_id(empire) {}" In the default contructor anything after the colon is part of what is called "The constructor initializer list", or simply constructor initializers. They are meant to give default values to your member variables. You can google the terminology if you'd like to gain more insight on it. Multiple initializers are seperated by commas.
  15. Nervo

    Line printing with STL

    Hello. Identify your printer port number and go to this page, read the code and try it out for yourself: click Hope it helps.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!