From: hat AT se-46 DOT wpa DOT wtb DOT tue DOT nl (Albert Theo Hofkamp) Newsgroups: comp.os.msdos.djgpp Subject: Re: Beginners Question Date: 31 Oct 1997 12:43:56 GMT Organization: Eindhoven University of Technology, The Netherlands Lines: 24 Message-ID: <63cjqc$s2q@tuegate.tue.nl> References: <3458C5E6 DOT 47D7 AT bergen DOT mail DOT telia DOT com> Reply-To: a DOT hofkamp AT wtb DOT tue DOT nl NNTP-Posting-Host: se-46.wpa.wtb.tue.nl Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk In article <3458C5E6 DOT 47D7 AT bergen DOT mail DOT telia DOT com>, john kismul writes: > I've allocated some memory with malloc. > > How do I transfer data from this memory to somewhere else in memory, > such as, someother memory I've allocated or an array. When calling malloc, you gave the memory a type. For example, int *pInt = malloc(sizeof(int)); pInt is a pointer to an int, and points to the memory. In other words, the memory is an int and can be adressed as such. For example: *pInt = i; copies the value i to the malloc-ed memory. If you want to move larger pieces of data, have a look at memmove, or memcpy. Albert --- Freedom: A Linux-based GNU computer system