Search:

Type: Posts; User: CS_Student8337

Search: Search took 0.01 seconds; generated 29 minute(s) ago.

  1. Replies
    18
    Views
    25,681

    Here's the line: aStruct->name = string;

    Here's the line:


    aStruct->name = string;
  2. Replies
    18
    Views
    25,681

    Were aren't allowed to use buffers in the...

    Were aren't allowed to use buffers in the assignment for some reason
  3. Replies
    18
    Views
    25,681

    Hmm.. that's how I was trying to do it but I keep...

    Hmm.. that's how I was trying to do it but I keep getting this error when I try to compile:

    error: invalid type argument of ‘->’
  4. Replies
    18
    Views
    25,681

    Ok. One quick, little question. How do I get one...

    Ok. One quick, little question. How do I get one of the pointers in my struct to point to the string??
  5. Replies
    18
    Views
    25,681

    Cool. Thank you. I'll post again if I run into...

    Cool. Thank you. I'll post again if I run into any problems
  6. Replies
    18
    Views
    25,681

    Right. I didn't include any code to check if they...

    Right. I didn't include any code to check if they return NULL. I know I should for my program though. In the code I just posted I used fgetc(). Would it be possible to substitute fgets() instead?
  7. Replies
    18
    Views
    25,681

    I thought that's what it was but I wasn't sure...

    I thought that's what it was but I wasn't sure because the instructions say that the strings shouldn't have any wasted space.. So, is it ok to do something like this?


    int capacity = 1;
    int...
  8. Replies
    18
    Views
    25,681

    dynamically allocated strings??

    Ok, part of my assignment for school is to create a struct with 2 char pointers in it. These pointers are supposed to point to a couple of dynamically allocated strings and I'm supposed to create a...
  9. Replies
    10
    Views
    9,867

    Thanks to everyone who posted. I think I have it...

    Thanks to everyone who posted. I think I have it working properly now
  10. Replies
    10
    Views
    9,867

    No, messing with the sizes of fegts didn't help....

    No, messing with the sizes of fegts didn't help.

    #include <stdio.h>
    #include <string.h>
    #define MAX 6

    int main(void)
    {
    int c, i, j, k, output;
    char arrayA [MAX+1], arrayB[MAX+1];
  11. Replies
    10
    Views
    9,867

    Thank you for the response Cas. Taking the input...

    Thank you for the response Cas. Taking the input into a huge temporary array was originally what I was going to do but it's expressly forbidden in one of the bullets of the assignment. But I have...
  12. Replies
    10
    Views
    9,867

    Thanks for the help. That was a silly error on my...

    Thanks for the help. That was a silly error on my part. I have another question though and since it's somewhat related, I hope it's ok to ask it in this thread instead of creating another one.
    ...
  13. Replies
    10
    Views
    9,867

    Truncating user input

    What's the best way to truncate user input to a certain number of characters ( ie.6 characters)? tried using the following code but it doesn't seem to work properly for certain inputs.

    If I input...
  14. Replies
    4
    Views
    1,595

    Compilation Error. Need help

    Ok. I'm doing a Towers of Hanoi project and it's supposed to be a multi file program. I keep getting this error and I can't figure out why.
    hanoi.c:4: error: redefinition of ‘hanoi’
    hanoi.h:5:...
  15. Nevermind. Global or static variable, duh

    Nevermind. Global or static variable, duh
  16. Ok. I've got a pretty decent understanding of...

    Ok. I've got a pretty decent understanding of recursion itself now and am now working on my Tower program Everything's working well but I'd like to spice up my output a bit. Currently my output looks...
  17. Thanks for that link. I don't have the time to...

    Thanks for that link. I don't have the time to check it out right this second but I'm gonna look over it tonight or tomorrow morning. From the glance I had of it, it looks like exactly what I need,...
  18. Thanks for the quick response. I think that it's...

    Thanks for the quick response. I think that it's making a bit more sense.

    So for n=1 the if statement triggers, the function calls itself for 0, the if statement DOESN'T trigger. Then the print...
  19. Need help with understanding a recursion function

    void dohanoi(int N, int from, int to, int using)
    {
    if (N > 0)
    {
    dohanoi(N-1, from, using, to); //1
    printf ("move %d --> %d\n",...
Results 1 to 19 of 19