Mail Archives: djgpp/1999/12/10/02:12:03
| From:  | Steven Watson <steven DOT watson AT dtn DOT ntl DOT com>
 | 
| Newsgroups:  | comp.os.msdos.djgpp
 | 
| Subject:  | changing value of pointers
 | 
| Date:  | Fri, 10 Dec 1999 09:30:10 +0000
 | 
| Organization:  | Netscape Online member
 | 
| Lines:  | 37
 | 
| Message-ID:  | <3850C822.1B33F13B@dtn.ntl.com>
 | 
| NNTP-Posting-Host:  | p132-harc1-kirklees1.tch.dtn.ntl.com
 | 
| Mime-Version:  | 1.0
 | 
| X-Trace:  | nclient3-gui.server.dtn.ntl.com 944808802 4683 194.168.244.132 (10 Dec 1999 06:53:22 GMT)
 | 
| X-Complaints-To:  | abuse AT net DOT ntl DOT com
 | 
| NNTP-Posting-Date:  | 10 Dec 1999 06:53:22 GMT
 | 
| X-Mailer:  | Mozilla 4.6 [en-gb]C-CCK-MCD NetscapeOnline.co.uk  (Win95; I)
 | 
| X-Accept-Language:  | en-GB,en
 | 
| To:  | djgpp AT delorie DOT com
 | 
| DJ-Gateway:  | from newsgroup comp.os.msdos.djgpp
 | 
| Reply-To:  | djgpp AT delorie DOT com
 | 
Hi Everyone
Is it possible someone can tell me how this code can be written to
change the pointer sent to it
in pow! using a VAR it will make a copy so the value can be changed but
I am unable to figure it out in C?
int  main(void)
char *string;
  file_reads(1,5,&string);
    printf("%s \n",string);
return 0;
}
function from include file:
void file_reads(int handle,int length,char *dummy)
{
     if ((dummy=(char *)malloc(length+1))==NULL){
        puts("Error code here");
        exit(1);
     }
if((fread(dummy,sizeof(char),length,filehandle[handle]))!=length){
            puts("Put error code here");
            exit(1);
         }
                *(dummy+length)=0x00;
               printf("%s\n",dummy);//it prints here fine as expected.
return;
}
thanks in advance
Steven Watson
- Raw text -