Path: utzoo!attcan!uunet!wuarchive!zaphod.mps.ohio-state.edu!ncar!noao!stsci!davids From: davids@stsci.EDU (David Silberberg) Newsgroups: comp.lang.c Subject: Casting pointers Keywords: cast Message-ID: <1614@ghost.stsci.edu> Date: 19 Jul 90 12:57:05 GMT Organization: Space Telescope Science Institute, Baltimore, MD 21218 Lines: 21 Does anyone know if the following cast operation will perform correctly? main() { SOME_STRUCT_TYPE *ptr; int num_chars; ... (char *)ptr += num_chars; ... } If the last line above were replaced by ptr = (char *)ptr + num_chars; it would perform as desired. Does casting work on an lvalue? David Silberberg (davids@stsci.edu)