Advertisement Jump to content
  • Advertisement

raz0r

Member
  • Content Count

    350
  • Joined

  • Last visited

Community Reputation

586 Good

About raz0r

  • Rank
    Member
  1. raz0r

    TinyXML Help

    Cast it like this, instead: static_cast <int /*or double*/ *> (0);
  2. raz0r

    "Writing" into a Win32-Window-App.

    Windows GDI Font and Text Functions. DrawText, TextOut, etc.
  3. raz0r

    Float to string method

    Quote:Original post by swiftcoder #include <sstream> int main() { float f = 123.456f; // or whatever std::ostringstream oStr; oStr << f; std::string value = oStr.str(); } Fixed.
  4. They are different types, and as you have already seen, you can't convert between them without an explicit cast. Just a thought: are you sure that you're unable to use std::basic_string <unsigned char> to solve your problem? In any case, IIRC, std::basic_string has a constructor and an assign function that take an iterator range, so you might be able to use that.
  5. Roughly speaking: void Remove(std::string & rString, char cWhat) { rString.erase(std::remove(rString.begin(), rString.end(), cWhat), rString.end()); } //... std::string Data(...); Remove(Data, ' ');
  6. raz0r

    whitespace in strings

    Those two "extra" characters that you speak of are probably '\r' and '\n'. Don't let fopen see them...
  7. raz0r

    whitespace in strings

    Also: char* filename = new char[20]();
  8. raz0r

    sprint warning

    sprintf_s's signature:Quote: int sprintf_s( char *buffer, size_t sizeOfBuffer, const char *format [, argument] ... ); Where sizeOfBuffer is the maximum number of characters to store in the target buffer. Keep in mind that this isn't portable. If VS is bugging you about it and you wish to stick with the "old" version, define _CRT_SECURE_NO_WARNINGS to get rid of these warnings.
  9. raz0r

    2 byte ints from 4 bytes?

    Quote:Original post by Driv3MeFar I'm fairly certain it's illegal to #define a reserved keyword (which is not to say some compiler's won't let you do it [rolleyes]).AFAIK, it's perfectly legal. It's simple text substitution.
  10. raz0r

    wassup with da code?

    Quote:Original post by Alpha_ProgDes Since when? I thought that was standard, as in C++ standard. I'm not sure I follow what you're saying; if there is no return statement in main the standard guarantees that by default return 0 will be executed.
  11. raz0r

    How to open a URL with C++?

    Note: Win32 Calling ShellExecute will open the target URL in your default web-browser.
  12. Quote:Original post by Moe #region put_a_region_name_here //your code goes in here that you want to collapse #endregion Quote:Original post by MARS_999 Sorry that didn't work. In the VC++ editor these are pragma directives: #pragma region RegionName //... #pragma endregion
  13. Quote:Original post by ArchG Any idea how to read the text in it now? Try sending WM_GETTEXT to the control in question (via SendMessage). You might also find the WM_GETTEXTLENGTH message useful.
  14. raz0r

    Stupidity again?

    You must include the standard new header in order to use placement new.
  • 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!