Quote Originally Posted by officedog View Post
Code:
void getUserInputLine(FILE * fp, char * ps) {
    char buf[100];
    if ( ((ps = fgets(buf, sizeof(buf), fp))) != NULL) {
        printf("\n%s", buf);
        printf("\n%s", ps);
    }
}

int main (int argc, const char * argv[]) {
    char * pString;
    getUserInputLine(stdin, pString);
    return 0;
}
That does absolutely nothing. The pointer is passed to the function by value, so the assignment 'ps = ' is applied to the copy, not the variable declared within the scope of main. To get all that to work would require passing a char**.