Search:

Type: Posts; User: mash4t

Search: Search took 0.00 seconds.

  1. Replies
    11
    Views
    3,332

    I didn't write the testEndian function myself, it...

    I didn't write the testEndian function myself, it was one I found on the internet. However, it does seem to work for me, returning 1 for my intel mac, and 0 for the unix server it is going to be...
  2. Replies
    11
    Views
    3,332

    Yes, your test function works fine. It all gets...

    Yes, your test function works fine. It all gets swapped. But when I try with my actual image, I still get the 00006675 int, rather than the other way around.
  3. Replies
    11
    Views
    3,332

    Yes, but the function doesn't seem to do anything.

    Yes, but the function doesn't seem to do anything.
  4. Replies
    11
    Views
    3,332

    I'm pretty sure that I am getting the right .bmp,...

    I'm pretty sure that I am getting the right .bmp, and the header doesn't seem to have changed. What should I be printing with the printf's?
  5. Replies
    27
    Views
    3,839

    Thanks for all the help. Managed to get it...

    Thanks for all the help. Managed to get it working. Turned out it was the length of longs and I was on a 64bit system.
  6. Replies
    11
    Views
    3,332

    Confusing endian issue when using fwrite

    I am writing a program which outputs a .bmp file, and was having trouble with the header. Thanks to the awesome help of the people here, that is all sorted now. However, I have another, I think more...
  7. Replies
    27
    Views
    3,839

    Sorry about the late replying, had a bit of a...

    Sorry about the late replying, had a bit of a break for Christmas :P

    I am getting a size of 112 for the struct with this:

    typedef struct{
    unsigned char bm[2];
    unsigned long filesize;...
  8. Replies
    27
    Views
    3,839

    I've tried this: #pragma pack(push, 1)...

    I've tried this:


    #pragma pack(push, 1)
    typedef struct{
    unsigned char bm[2];
    unsigned long filesize;
    unsigned short reserved1;
    unsigned short reserved2;
    unsigned long headerSize;
  9. Replies
    27
    Views
    3,839

    Hmm, that doesn't seem to have made any...

    Hmm, that doesn't seem to have made any difference either. The output in textedit looks the same as well. This is all very confusing...
    (I meant changing it to short, will have a look at the other...
  10. Replies
    27
    Views
    3,839

    I probably should have put in my structures... ...

    I probably should have put in my structures...


    typedef struct {
    char bm[2];
    long filesize;
    int reserved[2];
    long headerSize;
    long infoSize;
    long width;
  11. Replies
    27
    Views
    3,839

    Changed it to wb, I still get the same result;...

    Changed it to wb, I still get the same result; the file refuses to open, I get the error message:

    "The file generatedPattern.bmp could not be opened, It may be damaged or use a file format that...
  12. Replies
    27
    Views
    3,839

    Broken .bmp output. Help!

    I am trying to write a program that outputs a bmp file. The code compiles, and runs, but the .bmp won't open! Where am I going wrong?

    Here is my code for generating the bitmap...



    void...
  13. Argh sorry stupid mistake - solved it.

    Argh sorry stupid mistake - solved it.
  14. integer Count doesn't increment properly, doesn't work with GCC, but does with CC

    Hi there.
    I am trying to write a program that approximates the integral of Cos^2, by working out the area under the graph.

    It was working on my home computer, running OSX, using GCC to compile,...
Results 1 to 14 of 14