Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!uwm.edu!rpi!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!gvlf3.gvl.unisys.com!tredysvr!paul From: paul@tredysvr.Tredydev.Unisys.COM (Paul Siu) Newsgroups: comp.lang.c Subject: When do you use const Keywords: const, #define, C Message-ID: <1220@tredysvr.Tredydev.Unisys.COM> Date: 1 Feb 91 16:53:26 GMT Organization: Unisys Corporation, Tredyffrin, PA Lines: 10 In ANSI C, you can define a variable as constant by preceeding it with const. You can for example define a double variable x that you cannot change by const double x; However, what is the advantage of using const over #define? Why was the reason for its addition to ANSI C. Paul Siu paul@tredysvr.tredydev.unisys.com