Search:

Type: Posts; User: Shahiddd

Search: Search took 0.00 seconds.

  1. Replies
    4
    Views
    4,988

    I allocated memory for visited array and now it...

    I allocated memory for visited array and now it prints "path exists" all the time, no matter the input.
    this is how i did it:



    bool bfs(struct Graph* graph, int startVertex, int destVertex) {...
  2. Replies
    4
    Views
    4,988

    Graph data structure

    I'm trying to code a function that checks if there is an edge between two nodes in directed graph. I found the code for this function in C++ on the internet and rewrote it into C, but i get error,...
  3. Thread: Code error

    by Shahiddd
    Replies
    4
    Views
    3,914

    Can you help please!

    Can you help please!
  4. Thread: Code error

    by Shahiddd
    Replies
    4
    Views
    3,914

    I did it but i didn't work In the excercise I...

    I did it but i didn't work
    In the excercise I supposed to write some code after the second for loop to make it work
  5. Thread: Code error

    by Shahiddd
    Replies
    4
    Views
    3,914

    Code error

    Hello,
    Can someone tell me what is wrong with the following code and how should i modify it to make it work. What should i write instead of 'rest of the program'

    insert



    #include <stdio.h>...
  6. Thread: Binary file

    by Shahiddd
    Replies
    11
    Views
    8,134

    Ok, but if I use || then the code will be...

    Ok, but if I use || then the code will be executed even if only one of the files suceed, right?
    example:
    insert


    if ( file1 == NULL || file2 == NULL || file3 == NULL )
  7. Thread: Binary file

    by Shahiddd
    Replies
    11
    Views
    8,134

    I guess it is better to use || Is the code...

    I guess it is better to use ||
    Is the code correct overall? Anything else to be considered?
  8. Thread: Binary file

    by Shahiddd
    Replies
    11
    Views
    8,134

    Is it better now? insert #include...

    Is it better now?

    insert



    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
  9. Thread: Binary file

    by Shahiddd
    Replies
    11
    Views
    8,134

    Binary file

    Hello

    I am working on binary files management and I've done an excercise but don't know if it correct or not. I have tried to do 1 Here is the excercise:

    Suppose you have a binary file called...
  10. I fixed it, Thank you both for the support!...

    I fixed it, Thank you both for the support! :redface:
  11. OK, so how should I do it if the list is unsorted?

    OK, so how should I do it if the list is unsorted?
  12. Any idea?

    Any idea?
  13. If the list is unsorted do I have to sort it in...

    If the list is unsorted do I have to sort it in ascedning order first before I search for the successor?
  14. successor and predecessor in doubly linked list

    Hello!

    I was wondering if someone could help with implementation of successor and predecessor in doubly linked list. I have searched everywhere on the internet but have not fould anything useful. ...
  15. Replies
    10
    Views
    4,623

    Yeah the variable declaration was the problem. It...

    Yeah the variable declaration was the problem. It worked after I just set it to zero, int sum_age = 0;
  16. Replies
    10
    Views
    4,623

    Sum doesn't have an initial value, it is given a...

    Sum doesn't have an initial value, it is given a value in the for loop where I add up ages of all students. The problem here is that list[i].age gets only age of the first student and doesn't...
  17. Replies
    10
    Views
    4,623

    ok, did you see any problem with sum_age? it is...

    ok, did you see any problem with sum_age? it is not adding up ages of all students properly
  18. Replies
    10
    Views
    4,623

    It worked!!! Your idea was way better than mine,...

    It worked!!! Your idea was way better than mine, to put the whole list into an empty list istead of putting every member of it into an empty list!
    Next i want to find sum of all male and female...
  19. Replies
    10
    Views
    4,623

    Student database

    HELLO!

    I am creating a student database with structs in C and I want to search for students by their names in the structure. I have tried strcmp function to compare the input name with student...
Results 1 to 19 of 20