From: Radical NetSurfer Newsgroups: comp.os.msdos.djgpp Subject: memset behavior Date: Wed, 23 Aug 2000 23:37:41 -0400 Message-ID: X-Newsreader: Forte Agent 1.8/32.548 X-No-Archive: yes MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 216.202.140.67 X-Original-NNTP-Posting-Host: 216.202.140.67 X-Trace: 23 Aug 2000 23:40:36 -0400, 216.202.140.67 Lines: 38 X-Original-NNTP-Posting-Host: 64.31.79.51 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I had a line of code like this: char buffer[100]; printf("%d %s\n", (char*)memset(buffer, '-', 64)); and what was discovered is: IF buffer already contains a string, "ABCD", THEN memset() as above printed: "-------------------------------------------------------------BCD" (truncated to fit here) OBSERVE: that the everything was MOVED DOWN THEN: the dashed-line added. QUESTION: Why would this be ? PROBLEM #2: There's no such thing as a memcat() routine... why? How can binary data (data containing 0x00) be CONCATED to accurately and properly return the size (pointer growth) of a buffer? (growing_pointer *)memcat(destination, source, n_bytes); such that "growing pointer" is simply something that provides the buffer address of 'source', and its length. Any ideas here? THANKS Email welcomed: radsmail AT juno DOT com URL: members.tripod.com/~RadSurfer/