Search:

Type: Posts; User: Kurtanius21

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    8
    Views
    1,250

    That helps a lot. I need this simple language to...

    That helps a lot. I need this simple language to help me understand it. Thanks whiteflags
  2. Help understanding Malloc snippet of code

    I'm trying to comprehend what is going on in the following code. I know it takes pointers and allocates memory, but varying use of stars and need for a loop is throwing me off. This code is correct....
  3. Replies
    8
    Views
    1,250

    In response to your statement, is that why the...

    In response to your statement, is that why the following is ok to do?

    Say I've declared a variable



    int variable;


    Say I want to pass it into a function, whose prototype is
  4. Replies
    8
    Views
    1,250

    Is my understanding correct for Your **char...

    Is my understanding correct for Your **char example C99tutorial?12346

    12346

    So **S points to pointers, and each *S is a pointer. But what do *S point to exactly? Do they point to the base...
  5. Replies
    8
    Views
    1,250

    Structure and Malloc Confusion.

    I'm going over a practice final. I don't understand a malloc line in the sample code. The code is supposed to read rooms of a household specifications (area, room type, and number of windows)....
  6. Wow! It works if I add the display(stringA) after...

    Wow! It works if I add the display(stringA) after the display(stringB)! I really don't have any idea why! Anyone care to explain how this thing works? I really want to understand recursion, not just...
  7. I'm trying to follow your suggestion stahta. I'm...

    I'm trying to follow your suggestion stahta. I'm still having trouble. I'm trying to implement the replace_first_x() function as you suggested. Here's what I got


    int replace_first_x( char...
  8. The instructor said there is no need for malloc. ...

    The instructor said there is no need for malloc.

    Do you think you could elaborate further Salem? An if statement would get me first x, then how do I create two recursions, one for the 0, and...
  9. Help with Recursion. I'm so lost on this homework problem.

    Here's the problem description:

    “Write a recursive function that displays all the binary (base 2) numbers represented by a string of xs, 0s, and 1s. The xs represent digits that can be either 0 or...
  10. Replies
    4
    Views
    667

    I got it to work! I just had use strtok to...

    I got it to work! I just had use strtok to eliminate the space chars in the arrays. End thread!
  11. Replies
    4
    Views
    667

    Something is killing my fgets input. Once the...

    Something is killing my fgets input. Once the program encounters the element with a space, I replaces the first letter with \000
  12. Replies
    4
    Views
    667

    Apparently some of my elements in my arrays have...

    Apparently some of my elements in my arrays have spaces at the end of the subject. How can I get around this issue? I need the subject entered by the user (without the space) to match the array...
  13. Replies
    4
    Views
    667

    gdb shows me that the variable stri loses its...

    gdb shows me that the variable stri loses its subject string when j = 47. I'm confused.
  14. Replies
    4
    Views
    667

    Strange For loop problem.

    My program isn't working properly. This is the weirdest thing ever. Here is my function:

    void find_subject( int **crns, char ***subjects, char ***courses,
    int *count )
    {
    char input[4],...
  15. Replies
    12
    Views
    2,982

    That did it! Thank you click here!

    That did it! Thank you click here!
  16. Replies
    12
    Views
    2,982

    Also, flush isnt working for me. I get the same...

    Also, flush isnt working for me. I get the same old problem if I enter the code. Endless prompts and never a chance to enter the subject.

    printf("Please enter a subject: ");
    fflush (stdout);...
  17. Replies
    12
    Views
    2,982

    So now I've got a new problem. I've adjusted my...

    So now I've got a new problem. I've adjusted my code according to a FAQ. It is now

    void find_subject( int **crns, char ***subjects, char ***courses,
    int *count )
    {
    char input[4], str[4];...
  18. Replies
    12
    Views
    2,982

    Uhh, I'm totally flabbergasted by your answer....

    Uhh, I'm totally flabbergasted by your answer. What is stdout? I don't have any stdout in my code. What do you mean by flushing? I have never heard of the function fflush. Should I just type that...
  19. Replies
    12
    Views
    2,982

    Fgets not reading stdin. Help please.

    I'm creating a simple function that reads three letters. The problem is, gdb shows me that the printf inquiry occurs after all the fgets and suggested newline elimination loops. Here's what gdb says...
  20. That worked! thanks!

    That worked! thanks!
  21. So if I add to the while loop check condition ...

    So if I add to the while loop check condition



    while ( i < count - 1 )


    I get the value 8. But 9 exists at the end of the array. gdb showed that. How can I get the 9 to print?
  22. I entered in your suggested modification...

    I entered in your suggested modification Whiteflags. Least gives me zero. It works. Most is still faulty. here's what gdb reads.

    37 if ( ar[i] > *most )
    1: *most = 9
    (gdb) s
    38 ...
  23. I'm not giving the pointers something to point to...

    I'm not giving the pointers something to point to at line 29? If that's not the case, doesn't malloc give the pointers something to point to?
  24. While Loop Kills my Pointer Value. Please help.

    Using gdb, I know the while loop kills my pointer value when the check condition is no longer true. Why is this, and how can I remedy this? My main function just prints 124231523 124323232. Main btw,...
  25. Replies
    3
    Views
    1,391

    Understanding Pointers - Easy Questions.

    I'm having so much trouble grasping pointers. I'm experimenting with pointers and I expect to ask several questions on this thread. My first confusion is notation.

    I've gotten over declarations at...
Results 1 to 25 of 33
Page 1 of 2 1 2