I'm still trying to get this to work, but I'm much closer due to your response.
Type: Posts; User: cjtotheg
I'm still trying to get this to work, but I'm much closer due to your response.
Hello.
I'm having a difficult time figuring out how to set the plines[n] pointer. It looks like the realloc is working in the sub program, but I'm not having luck with printing it out in the main...
Thanks for the responses. I understand it now.
How many books do you have that don't mention strdup()?
I can imagine a few... but let me explain what my problem is.
I don't know what it does! (other than duplicate a string using malloc) I...
ahhh yes... thanks for that.... it works just fine... so precise. Have to tell it which directory it's in I guess.
I'm simply trying to compile and run a c program from command line in Linux Red Hat 7.2. Here are my steps:
1. I compile a simple hello world program using this:
gcc -g -Wall -ansi -pedantic...
I finally got this to work by changing it this way:
#include <string.h>
#include <stdio.h>
#include <ctype.h>
int main(void)
{
int k, len;
char line[100];
This code is supposed to strip blanks in an array if any exist to the right of a non-blank, but leave the rest of the string as-is. Pretend input may or may not have blanks to the right and you want...