Search:

Type: Posts; User: eatwithaspork

Search: Search took 0.00 seconds.

  1. Nevermind, figured it out. The text file was...

    Nevermind, figured it out. The text file was using Windows line endings and readline() uses '\n' as the delimiter, causing the string to retain the '\r', which was causing the problem.
  2. std::string object is overwritten in output stream

    I'm a bit puzzled as to why this is happening. If I create an ordinary string object with some text, insert it into an output stream (in the example, cout), and then insert a plain old c-string,...
  3. Found the problem. The library I'm trying to...

    Found the problem. The library I'm trying to link statically is libtiff. I didn't phase me that libtiff could have a bunch of its own dependencies, which it does.

    Guess it's time to track those...
  4. Odd. I tried that, but linking it the .a file...

    Odd. I tried that, but linking it the .a file produces a bunch of undefined symbol errors. Linking in the .so works fine, but isn't that still dynamic linking at that point?
  5. GCC: Compiling with both static and shared libraries

    I apologize if this has been asked before; I searched the forum and didn't find anything.

    Is it possible to compile and link a program using GCC such that some of the libraries are linked in as...
  6. Replies
    8
    Views
    27,917

    Whoops, just forgot to add the args when typing...

    Whoops, just forgot to add the args when typing it (it's not actual code, just the general idea of what I was doing).

    Good point about bzero(). Not sure what I was thinking there.
  7. Replies
    8
    Views
    27,917

    I'm trying to find the emoticon that shows me...

    I'm trying to find the emoticon that shows me slapping myself upside the head.

    Using an unsigned char buffer fixed the problem. Thanks everyone.
  8. Replies
    8
    Views
    27,917

    The code I'm working with is this: int...

    The code I'm working with is this:


    int number = 500;
    char charArray[4];
    bzero( charArray, 4 );
    memcpy( charArray, &number, 4 );

    int i;
    for( i = 0; i < 4; ++i ) {
  9. Replies
    8
    Views
    27,917

    int to char array?

    What is the best way to go about converting a 4-byte integer into a char array such that each element of the array contains a byte from the integer?

    For example: I have an integer, 56, which looks...
Results 1 to 9 of 9