Search:

Type: Posts; User: MATT BOOTY

Search: Search took 0.01 seconds.

  1. Wait, how is that a bug, a null character is...

    Wait, how is that a bug, a null character is supposed to be at the end, so why shouldn't I put it at string[100] ?
  2. Alright, but why does assigning a null character...

    Alright, but why does assigning a null character at the 101st element even remotely have anything to do with those bizarre characters at the front of the string?
  3. Thank you laserlight

    Thank you laserlight
  4. Strings are not concatenating according to my understanding.

    So the point of this code, was to take a number and then that number will mean you are allowed to concatenate a number of string so to the original string.

    It worked!!

    But, not as well as I'd...
  5. Okay, so to compare an item to the pointer's...

    Okay, so to compare an item to the pointer's content I have to de-reference it and tell the machine that "hey, make that pointer a char again", right? Kind of like doing str[i] == '\n' if I was...
  6. That's where I'm confused, a string is just an...

    That's where I'm confused, a string is just an array of chars, right? And a pointer is effectively the same as an array, right? So, why can't I compare a pointer to a char in this context?

    Well,...
  7. Understood.

    Alright, that explains why \n isn't registering, but that doesn't explain all of the other weirdness.
  8. I'm trying to understand why this string is being weird.

    So, in an effort to solve this problem, I'm trying to get how Strings work in relation to pointers.



    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include <ctype.h>
Results 1 to 8 of 8