Search:

Type: Posts; User: root

Search: Search took 0.01 seconds.

  1. Recommendations about the feasibility of a project

    Hi guys, I have a question about an idea for an university project.
    Based of the Mars idea (it's a mips32 simulator, here's a screenshot: http://tinyurl.com/qdforvk ) I was thinking about a similar...
  2. Replies
    2
    Views
    2,105

    Procedure print_person_info The print person...

    Procedure print_person_info

    The print person procedure is wrong, the printf prints "Name = %s %s, person.first_name, person.last_name" instead of you want to print, here some example printf - C++...
  3. Thread: Char arrays

    by root
    Replies
    5
    Views
    1,035

    My idea for doing the test was: #include...

    My idea for doing the test was:


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


    int main(void){
  4. Thread: Char arrays

    by root
    Replies
    5
    Views
    1,035

    Give a look to: strcat - C++ Reference...

    Give a look to:
    strcat - C++ Reference
    strcmp - C++ Reference
  5. Because the project must have communicating...

    Because the project must have communicating processes (it's an Operating System project) and I think this is a good case where use them.

    Btw thanks @anduril462 for your ideas. I've edited the...
  6. Ideas for multiple child processes in a poker project

    Hi, I'm trying to solve a problem with my project, in the assignment I just have 2 requirements:
    -client server
    -communicating processes
    and as project I've done a client-server poker app in C,...
  7. Replies
    11
    Views
    13,220

    Are there restriction about the number of...

    Are there restriction about the number of parameters of the function?
    if not, the solution is easier that the posted up there, and the problem can be formulated as follow:

    Write a recursive...
  8. Replies
    3
    Views
    1,511

    Pay attention with fgets: -Fgets automatically...

    Pay attention with fgets:
    -Fgets automatically add the terminating null char after reading maximum N-1 chars.
    -Fgets returns a char*(or NULL) so you can't call it with an int variable (zip)
    -why...
  9. Thread: Bubble sort

    by root
    Replies
    9
    Views
    1,769

    This is a better solution, in this way if there...

    This is a better solution, in this way if there aren't swaps(so it means that is ordered) it stops.
    Said formally, in the best case the time complexity of this implementation in 0(n) instead of...
  10. Replies
    15
    Views
    2,362

    You're welcome :) I don't know how to give a...

    You're welcome :)

    I don't know how to give a hint, I'm trying to explain it in a high level pseudocode



    function print_stack(stack s)

    if the stack isn't empty then
    ...
  11. Thread: Looping

    by root
    Replies
    12
    Views
    1,390

    I don't really think that this exercise may help...

    I don't really think that this exercise may help you to pass an exam 2 hours before it..
  12. Thread: Looping

    by root
    Replies
    12
    Views
    1,390

    int i,j; for(i=5,j=1;i>0;i--,j++)...

    int i,j;
    for(i=5,j=1;i>0;i--,j++) printf("%d\n%d\n",i,j);


    or you can put them in an array and print them, what they rapresent?
  13. Replies
    15
    Views
    2,362

    Before saying "how" it's also important...

    Before saying "how" it's also important understand "why" I've said that.
    So,now you have an ADT stack with just a print function, suppose that you want to add functions to find max and min, to add...
  14. Replies
    15
    Views
    2,362

    I'm not sure that your code is correct, in a...

    I'm not sure that your code is correct, in a stack you can't access to an element without have done the pop of the previous elements.
    your print function scans the stack like a linked list.
  15. Right observation :), if you want to exit if the...

    Right observation :), if you want to exit if the allocation fails you can call the exit function writing
    exit(1);
  16. Replies
    15
    Views
    2,362

    why don't you use a recursive function to print...

    why don't you use a recursive function to print elements?
    It became easier and you can do it without modify the stack.
  17. you have to allocate memory for a string, you...

    you have to allocate memory for a string, you dont' need buff variable
    Try


    lunch[x].name=malloc(50*sizeof(char));
    /*I'm assuming that the food name is shorter than 50 characters, write ...
  18. Be careful, line 17: you've declared an array...

    Be careful,
    line 17: you've declared an array of struct of 5 elements, you can access to element with 0≤indexf≤4 , there's an out of bound

    It's more versatile to define a structure tag or...
  19. Replies
    55
    Views
    12,403

    use a float a make a cast when you divide ...

    use a float a make a cast when you divide



    float quotient;
    .....

    quotient = (float)first_Num / sec_Num;
    printf("\nThe quotient of %d and %d is %f\n\n", first_Num, sec_Num, quotient);
  20. Replies
    3
    Views
    4,782

    first of all thank you for the answer :), I've...

    first of all thank you for the answer :),
    I've given a look to the contents, it seems a lot theoretical, what I'm looking for is a book or everything for the lab part, the implementation in C of...
  21. yes, an array isn't passe by value, there's an...

    yes, an array isn't passe by value, there's an implicit conversion array-pointer and in the function you have a pointer to the first element, in fact in the function write array[3] or *(array+3) is...
  22. Replies
    3
    Views
    5,381

    now it should work

    now it should work
  23. Replies
    3
    Views
    4,782

    books title for c data structures exercises

    Hi all, I'm a computer science student, I've opened this thread to ask you a title of book/ebook/site/etc where I can find exercises solved of C data structures.
    At my Algorithms course we use as...
Results 1 to 23 of 24