Search:

Type: Posts; User: rmmstn

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    314

    I managed to solve the issue. I was using fixed...

    I managed to solve the issue. I was using fixed sizes for region and country and I think they were to small. I replaced them with dynamically allocated arrays and it's working
  2. Replies
    3
    Views
    314

    Where is the mistake in my code?

    I have a CSV file of the following format:
    Region, Country, Item Type, Sales Channel, Order Priority, Order Date, Order ID, Ship Date, Units, Sold, Unit Price, Unit Cost, Total Revenue, Total Cost,...
  3. The address will always evaluate as true warning

    #include <stdio.h>
    #include <stdbool.h>


    #define M 5
    #define N 5


    // 2 - free spot ; -1 - vertical line ; -2 - horizontal line ; 1 - X ; 0 - 0
  4. You're right, my lcp() function was the issue,...

    You're right, my lcp() function was the issue, it's working perfectly now, thanks a lot!
  5. I've tried doing char *result = NULL;...

    I've tried doing


    char *result = NULL;
    result = (char *)malloc(sizeof(char) * 100);




    But I'm still facing the same issue when debugging :/
  6. Yes this works, but does this till use divide and...

    Yes this works, but does this till use divide and conquer? I'm just learning this method and I can't always recognize it
  7. Longest common prefix divide and conquer - seg fault

    I'm trying to write a program that prints the longest common prefix, using divide and conquer, but I'm getting a seg fault and I'm not certain why. I'm guessing it has something to do with the result...
  8. Replies
    2
    Views
    850

    I've updated the code: #include ...

    I've updated the code:


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


    #define MAX 1000
    #define HEIGHT 24
  9. Replies
    2
    Views
    850

    Solve maze backtracking

    I'm trying to solve a maze from 'S' to 'E', then printing the solution with a '.' in each cell from the path. The maze is:

    ...
  10. How to count number of digits of printf argument?

    So, I know the question sounds strange but I don't really know how to phrase it better. I'll try to explain: I'm writing my own version of printf, this is the code I have so far:


    #include...
  11. Replies
    2
    Views
    809

    qsort not working on array of structs

    I'm trying to sort data from a .csv file based on the year (3rd field), using qsort and bubble sort to test the speed of both:


    Look What The Cat Dragged In,Poison,2001,Look What The Cat Dragged...
  12. Replies
    4
    Views
    920

    #include #include #include...

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


    #define MAX 3000


    typedef struct{
    char name[100];
  13. Replies
    4
    Views
    920

    Create tar-like archiver

    I want to write a simple version of tar, that is able to archive files provided as command line arguments (no compression needed). I've just started learning about binary files so I'm a bit lost.

    ...
  14. Replies
    8
    Views
    849

    Nevermind, I didn't see he defined each function...

    Nevermind, I didn't see he defined each function after main :/
  15. Replies
    8
    Views
    849

    I see, I've never encountered them before, that's...

    I see, I've never encountered them before, that's why
  16. Replies
    8
    Views
    849

    Could you please explain this part? I don't...

    Could you please explain this part? I don't usually use global variables, why did we declare them globally and not in main. Also, would it be possible to use a struct until entry, then use another...
  17. Replies
    8
    Views
    849

    Printing readable data from ELF file

    I want to print the file, program and section headers from an ELF file, but I'm getting some weird results.



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


    typedef struct{
  18. Replies
    1
    Views
    814

    Issue with typecasting float to int

    #include <stdio.h>


    int main()
    {
    int i = 0;
    for(i = 0; i <= 10; i++)
    {
    float offset = (i/1000)*256;
    printf("%d\n", (int)(offset));
  19. Replies
    3
    Views
    837

    So should I initialize with strlen(word)+1 *...

    So should I initialize with strlen(word)+1 * sizeof(char)?
  20. Replies
    3
    Views
    837

    Why do I get segmentation fault

    I need to parse data from a csv file but for some reason I'm getting a segmentation fault error. I have exactly 5 comma separated fields on each line so I wanted to use an array of pointers to hold...
  21. Okay, so if I declare c as an int could implement...

    Okay, so if I declare c as an int could implement the same logic and just typecast c to char?
  22. Count number of occurrences of each character in input

    I want to count the number of occurrences of each character found in the input and print it to the output.


    #include <stdio.h>
    #include <string.h>
    int main(int argc, char **argv)
    {
    ...
  23. Replies
    1
    Views
    587

    How to go back from switch menu

    I want to make a menu that classifies animals into insects, birds, mammals and fishes with specific characteristics for each of these (using composite variables). I thought I'd use a nested switch...
  24. Replies
    1
    Views
    965

    Print sorted lines from file

    I have the following .txt file:
    1 7 9 12
    8 4 22 5
    4 9 0 10
    15 2 3 14
    I wanna print the lines in descending order based on the average value on each individual line.

    ...
  25. Replies
    2
    Views
    788

    Thank you! If I wanna work with dynamically...

    Thank you! If I wanna work with dynamically allocated arrays is this the way to go?


    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include <ctype.h>
    #define MAX 100
    unsigned...
Results 1 to 25 of 69
Page 1 of 3 1 2 3