CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Richard.J

Page 1 of 5 1 2 3 4

Search: Search took 0.06 seconds.

  1. Re: winsock... binding to WRONG IP byte order WORKS!

    I think you are confusing two things:
    1. when setting up a connection, you always use the host byte order, because that is what is used internally on the system you are working on. It is the OS's...
  2. Replies
    1
    Views
    144

    Re: Problem about file handling!!!

    ofstream file;
    file.open("text.dat", ios:app | ios::binary);
  3. Replies
    4
    Views
    301

    Re: Macro to template

    Google yields a list:
    http://www.google.com/search?q=using+namespace+in+header+file
    This post:...
  4. Replies
    66
    Views
    1,008

    Re: getting a binding error in server program

    http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html
  5. Re: ofstream writing replaces entire file with 0s

    ios::out erases an existing file. So if you open an existing file with that option, then seekp to a position, all bytes before that position are filled with 0x0.
    It's not Philip Nicoletti's...
  6. Thread: std::mutex

    by Richard.J
    Replies
    3
    Views
    642

    Re: std::mutex

    I only have g++ 4.6.1, but looking at /usr/local/include/c++/4.6.1/mutex it seems that the mutex class is protected by some #defines.
    I found a (german) article on the web which mentions that you...
  7. Replies
    5
    Views
    479

    Re: Struct member manipulation

    You might want to look up 'bitfields':
    http://msdn.microsoft.com/en-us/library/ewwyfdbe(v=vs.71).aspx
    http://en.wikipedia.org/wiki/Bit_field

    But be aware that the implementation is...
  8. Re: If someone can tell me why my program crash

    Did you use the debugger to debug your code?
    What if either con, stmt or res are nullptrs? The example relies on them not being nullptrs, but if they are, your program will crash as it does.
  9. Re: Unable to compile C lib of FatFS with C++ Project

    What compiler do you use?
    What error messages do you get?
  10. Re: giving one line command that prints lots of lines - ostream?

    must be "std::endl"
  11. Re: giving one line command that prints lots of lines - ostream?

    The quickest thing would probably be the use of a ostringstream


    #include <sstream>

    std::ostringstream os;
    os << "hello\n";
    os << "mike\n";
    os << "how\n";
    os << "are\n";
  12. Re: [Newbie] SIP parser and header-file including (using sofia-sip)

    You are most likely missing a header file where the struct/class/whatever sip_default_mclass is declared.
  13. Re: custom streambuf for use with std::fstream?

    Ah, this looks promising and is part of 1.45.0 which is what I am currently using.

    Thanks again.
  14. Re: custom streambuf for use with std::fstream?

    Yes, opening the file n times would be simple, but I want to get rid of the eof check which would involve checking if the data section has reached its end. I do need a seekable stream, I will have a...
  15. custom streambuf for use with std::fstream?

    I have an application which uses several files to store its data.
    The data is organized to store all current data like this, and additionally the data is moved to a single file after a specific time...
  16. Replies
    6
    Views
    616

    Re: Validate unsigned operations?

    VisualStudio 2010 issues a "warning C4296: '>=' : expression is always true" when the warning level is set to /Wall. However, this level is quite a pain as a lot of headers that come with the...
  17. Re: I wish to replace spaces with underscores in a sting

    You can simply pass the second string to the function as well:


    #include <string.h>
    #include <stdio.h>

    /* assume pString is null terminated and is not NULL */
    void ReplaceChars(char...
  18. Re: I wish to replace spaces with underscores in a sting

    There is no 'replacestring' in the file you posted.
    Post a minimum example here that reproduces the problem. Do not attach files, post the code using code tags.
  19. Replies
    2
    Views
    525

    Re: c++ Conversion Program Help for Newbie.

    1 lb = 0.453 592 370 kg(exakt, per definitionem) (according to Wiki)
    1 kg ≈ 2.204 622 622 lb

    What do you have written so far and where are you having problems?
  20. Replies
    2
    Views
    855

    Re: Mingling IPv4 and IPv6

    A quick google search came up with this converter: http://ipv6.ztsoftware.net/
    I could not find a page explaining the conversion rules, but maybe this can help you as a starting point?
  21. Re: [Beginner] Incorrect Output for a Simple Code

    If all of the comparisons fail, your last else-statement is entered and that is the output you get.
    Looking at your logic I assume that you are missing a comparison for c1, c2 and c3 == 1. If you...
  22. Re: DHCP Discovery Program - Need Help With Boot Options

    Did you check this RFC: http://www.faqs.org/rfcs/rfc2132.html?
    It seems to contain anything you need.
  23. Replies
    10
    Views
    472

    Re: Postfix Operator Overloading Error!

    As the compiler states: you did not define a postfix operator++, although you comment your prefix operator++ as such.


    // postfix: returns the object in its old state
    Counter operator ++(int)
    ...
  24. Replies
    10
    Views
    492

    Re: Switch Output Error

    You can also define an operator<< for the enum:


    std::ostream& operator<<( std::ostream& os, period p )
    {
    switch(p)
    {
    case hourly: os<< "hourly"; break;
    case weekly: os<<...
  25. Replies
    10
    Views
    492

    Re: Switch Output Error

    In putdata, you are writing ch which is a char. That is the reason for the funny output.
    Try


    cout << "\nPayment Period is " << static_cast<int>(ch) << '\n';
Results 1 to 25 of 119
Page 1 of 5 1 2 3 4



HTML5 Development Center

Click Here to Expand Forum to Full Width