Search:

Type: Posts; User: DGB_684

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Though it still crashes even if I change it to...

    Though it still crashes even if I change it to i-qi
  2. Well it appears to run fine when I break before...

    Well it appears to run fine when I break before the first if statement but for ((RGBArray[i+qi][j+qj].red != QueryArray[qi][qj].red) || (RGBArray[i+qi][j+qj].green != QueryArray[qi][qj].green ||...
  3. Finding a smaller array within a larger 2D array

    I have this code to try and locate a small array within a big array but it seems to crash on the first if statement. Both arrays are dynamically allocated from files and point to a strcuture.

    ...
  4. Replies
    2
    Views
    2,312

    Solved it! It was just a pointer mistake. This...

    Solved it! It was just a pointer mistake. This code I sent was fine.
  5. Replies
    2
    Views
    2,312

    Adding Two 2D Arrays Together

    I've been trying to add two 2D arrays together with different element types: red, green and blue that point to a structure. I'm pretty sure the two arrays are read in correctly I just don't think...
  6. Replies
    0
    Views
    2,308

    Using realloc to change array values

    So I've declared two arrays like this (red, green and blue are in a structure and the head pointer is just used to locate which file I'm looking at):


    int i, j, qi, qj, identify_x, identify_y;
    ...
  7. Though I believe the for loops in the code are at...

    Though I believe the for loops in the code are at least correct.
  8. Well if I'm stuck I generally look it up and...

    Well if I'm stuck I generally look it up and repurpose found code to better understand it so I can do it myself.
  9. I've tried this based on another post I've found...

    I've tried this based on another post I've found on this subject. Where head[1].height/width is for the big array and head[2].height/width is for the smaller (query) array. i and j are width and...
  10. Finding A Smaller Array Within A Bigger Array (2D)

    I've got two 2D arrays declared and I want to write some code to find the smaller one within the bigger one. Any tips on how this could work? I know it involves something like looping the values of...
  11. Replies
    4
    Views
    3,388

    Edge Detection Of A PPM Image In C?

    So far this is what I've got:

    What I'm trying to do is read in a PPM, store it in an array (done), then prompt the user to enter a threshold. Then detect the edges in an image and output to a new...
  12. Replies
    6
    Views
    2,431

    I've made your suggested changes and it works...

    I've made your suggested changes and it works now! Thanks a lot! The array doesn't look all that pretty but it works fine now!
  13. Replies
    6
    Views
    2,431

    This is one part of a larger piece of code. In...

    This is one part of a larger piece of code. In the main code is ~350 lines of code plus and I used functions in there. That's also why I have so many variables. Yes it is confusing but I can't really...
  14. Replies
    6
    Views
    2,431

    Oh ok I overlooked that one thanks. The other...

    Oh ok I overlooked that one thanks. The other errors still persist unfortunately...
  15. Replies
    6
    Views
    2,431

    Reading In PPM Pixels As RGB Integers

    So my code involves reading in a PPM image and then storing it in an array so it can be saved in an new ppm file. Though I think there is a problem with my pointers that means its not actually...
  16. Replies
    7
    Views
    3,018

    I changed it to this but I still don't think its...

    I changed it to this but I still don't think its right. The point of this program is to read in (pixel) values from a ppm file, store them in an array and then write them into a file. So I want the...
  17. Replies
    7
    Views
    3,018

    typedef struct { int rgb_comp_colour; ...

    typedef struct
    {
    int rgb_comp_colour;
    char buff[16];
    char filetype[2];
    int height;
    int width;
    } PPMHead;
  18. Replies
    7
    Views
    3,018

    Ohhhh. I see. How would I initialise it? Is it...

    Ohhhh. I see. How would I initialise it? Is it similar to initialising a pointer?
  19. Replies
    7
    Views
    3,018

    Writing an array to file

    I've been trying for ages to get this code to work but it just presents me with a blank file every time. Any help is very much appreciated.



    #include <stdio.h>
    #include <stdlib.h>
    #include...
  20. Replies
    17
    Views
    11,044

    What is happening there? I never got any of those?

    What is happening there? I never got any of those?
  21. Replies
    17
    Views
    11,044

    I think that is an accident. The malloc should be...

    I think that is an accident. The malloc should be in the for loop. Yes I guess image processing not everyone is familiar with which is why I've found it so hard to get help on this. Its more to do...
  22. Replies
    17
    Views
    11,044

    Cool. Thanks. Here is the updated code. But the...

    Cool. Thanks. Here is the updated code. But the errors were mostly minor so not much has really changed.



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


    #define maxheight 1080
  23. Replies
    17
    Views
    11,044

    Ok. I think I managed it. But I still have the...

    Ok. I think I managed it. But I still have the three original errors popping up despite resolving the rest.
  24. Replies
    17
    Views
    11,044

    Great. Thanks. Would you have any idea how to do...

    Great. Thanks. Would you have any idea how to do that in visual studio code?
  25. Replies
    17
    Views
    11,044

    Its quite long but this is all my code. ...

    Its quite long but this is all my code.



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


    #define maxheight 1080
Results 1 to 25 of 34
Page 1 of 2 1 2