Path: utzoo!mnetor!tmsoft!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!caen!sdd.hp.com!spool.mu.edu!uunet!shelby!sri-unix!mxmora From: mxmora@sri-unix.SRI.COM (Matt Mora) Newsgroups: comp.sys.mac.programmer Subject: New Think C user Message-ID: <21005@sri-unix.SRI.COM> Date: 8 Feb 91 17:19:02 GMT Reply-To: mxmora@sri-unix.sri.com (Matt Mora) Organization: SRI International, Menlo Park, CA Lines: 44 I am a proud new owner of THINK C 4.0.2. Is there any goodies out there that would make programming in this environment even more fun? I'm looking for any INIT's,FKEYS, source code, headers,gotcha's or any general information I should know about. I have a beginning C programming question. This question came up in my C class and the instructor didn't now the anwser. Why do you have to use a double percent sign in a string literal to have it print a percent sign when all logic would indicate that a backslash percent sign should work? Example: Anytime you want to include a special character you preceede it with a back slash. printf("this will beep\a"); printf("this will tab\tthis part over"); printf("you are %d years old.\n",age); So you would think that since the percent sign is the mask in a string literal that if a backslash was before it, the compiler would do the right thing. printf("this won't work %d\%percent",intrate); This wll actually print out a pointer from who knows where. printf("this does work %d %%percent",intrate) Just curious Thanks Matt -- ___________________________________________________________ Matthew Mora | my Mac Matt_Mora@QM.SRI.COM SRI International | my SUN mxmora@unix.sri.com ___________________________________________________________