http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

TheGrumpyProgrammer



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

C Programs



> i've just aquired C++ builder dowload (no manual)  i
> have some books though;  when i try to write some code
> i cant see the output when i try to see the output. 
> im using c code (im startin in c maybe try both at
> same time) but i want to use builder and i need a
> little direction.  i have turboc(2.0) and that seems
> to use c code fine.

Since you're using C (Like myself) and just starting, probably the easiest
way to display output is simply to use a standard text-output routine. If
you're compiling a DOS or console application (with a main() style entry
point), printf() is likely the simplest. It takes a string for it's first
argument, followed by a variable-length list of arguments which are
inserted into the string in order wherever a %s (string), %d (int), %f
(float), ad etcetera is found. Use \n for a new line. You probably want to
look up a list of all the different symbols that the function uses on the
web. If you're making a Windows program (with a WinMain() style entry
point), a cheap way of displaying messages is to call MessageBox(NULL,
"Message", "Title", MB_OK). I understand that because of the calling
conventions of Windows functions, they can't use variable-length argumant
lists. To display values of variables, instead of "Message", you could use
an array of chars (a string variable) and wsprintf(stringvar, "The value of
foo is: %d", foo) before displaying the box.

--< discontinuity >--

> Isn't lcc C-only? No C++ with lcc right?

I never noticed, but now that you mention it, I'll check . . . <checking> .
. . I think that you're right. Looks like it supports a couple of
languages, but not C++.

-- Neil Edelman
-- ICQ UIN: 705130
-- email: mailto:dreaded.neil@phreaker.net?subject=sig
-- home: http://members.xoom.com/dreadedneil
-- moop: http://moop.bizland.com
-- "My air-to-air missile overrides your air traffic control clearance"
=================================================================
The GameProgrammer.Com mailing list is for the open discussion
of any topic related to the art, science, and business of
programming games. This list is especially tolerant of beginners.
We were all beginners once

To SUBSCRIBE or UNSUBSCRIBE please visit:
http://gameprogrammer.com/mailinglist.html