Author |
Message |
Mark #1 / 9
|
 Want to get started in C
Hi there I'm fairly competent in various basics, unix shell, javascript and a bit of perl, and now I would like to learn a big boy's language ;) I've been coding in PocketC for PalmOS on my Palm Pilot which has taught me a lot about the structure and syntax of C. I've got the PocketC compiler, which obviously builds the code into an executable binary, and also a GUI toolkit called CControls, which adds a whole load of GUI functions in the form of #include-able source, eg Cbutton() for defining a button, Cdraw() to draw the button and Csetcontent() to set the label of the button, and so on for various GUI widgets. Now, I would like to find equivalent applications for Windows. Assuming that "normal" C works in the same way as PocketC, I need the following: 1. A compiler Recommendations for a cheap (preferably free!!!) compiler, ideally one that doesn't run in dos mode as I'm running XP so I'm not sure how well a command line compiler would run. A Windows based compiler would be nice. 2. A GUI toolkit Equivalent of CControls mentioned above, to add GUI building functions. Or are these built in to "standard" C? If so how can I find out about them? Thanks for any and all advice. Mark
|
Fri, 04 Feb 2005 03:59:27 GMT |
|
 |
Malcol #2 / 9
|
 Want to get started in C
Quote:
> Now, I would like to find equivalent applications for Windows. Assuming that > "normal" C works in the same way as PocketC, I need the following:
You have got to understand that there are three levels to C. Firstly there is the ANSI C language itself. This is quite a small languge with about twenty keywords and maybe twenty operators. I would be surprised if Pocket C did not implement this language in the normal way. Secondly there are the ANSI C standard libraries. These are enough to write simple command line applications. They include the printf() family of functions, a maths library, string functions, and so on. However you cannot expect to write a Windows program using just the standard library - there are no facilities for graphics for example. Pocket C may or may not implement this standard library. Thirdly there are extensions. For instance Microsoft Visual C provides a rich set of function to open windows, send messages, draw fancy text and graphics, add sound, and so on. Because there are so many extended libraries, they are off-topic here. Any ANSI C compiler will do for learning level 1 and level 2. For the best compiler to move on to level three, you will have to ask in a platform-specific group.
|
Fri, 04 Feb 2005 05:15:02 GMT |
|
 |
res19j1 #3 / 9
|
 Want to get started in C
Quote: > 1. A compiler > Recommendations for a cheap (preferably free!!!) compiler, ideally one that > doesn't run in dos mode as I'm running XP so I'm not sure how well a command > line compiler would run. A Windows based compiler would be nice.
If you don't mind a command-line compiler (version for Windows, not DOS) I'd reccomend DJGPP. It's simple to use (gcc myfile.c) and it works great. Just because it's a command-line program doesn't means that it's a DOS program. Windows comes with a CLI as well, so a command-line compiler will run just fine. If you really don't want to type that short bit into a shell then consider purchasing an IDE such as MS's VC++ (see question 2). Quote: > 2. A GUI toolkit > Equivalent of CControls mentioned above, to add GUI building functions. Or > are these built in to "standard" C? If so how can I find out about them?
There are no GUI components built into standard C. It doesn't even assume that a monitor is involved. If you don't mind using a C++ compiler, which will compiler nearly all C code and you want a set of good GUI controls try using Microsoft's Visual C++ Compiler with MFC (Microsoft Foundation Classes)
|
Fri, 04 Feb 2005 11:21:33 GMT |
|
 |
Jeff Binde #4 / 9
|
 Want to get started in C
Quote:
> Firstly there is the ANSI C language itself. This is quite a small languge > with about twenty keywords and maybe twenty operators. I would be surprised > if Pocket C did not implement this language in the normal way.
It doesn't, actually. The language used by PocketC bears only superficial resemblance to C, despite the name. For example, it lacks many of C's preprocessor facilities and data structures, and some of its operators. Moreover, PocketC's pointers, arrays and strings are nothing like C's.
|
Fri, 04 Feb 2005 13:25:39 GMT |
|
 |
Mark #5 / 9
|
 Want to get started in C
Thanks everbody for your prompt and helpful replies. Now I know that a command line interpreter will compile windows applications just fine, I don't mind using one. It looks like, in order to get GUI building functions I will need to go with one of the bigger IDEs. Most of the ones I've looked at are C++ environments. Forgive the basic question, but what is the difference between C and C++? I know that C++ is object oriented and uses classes, but I relly have no idea what either of these mean. Is a C++ compiler backwards compatable to C code? Will the larger IDEs provide functions for both codes? Are there many fundamental structural/syntactical differences between the languages? Sorry if this is a little off topic here but it's difficult to search for newsgroups containing the word "c" as there are thousands of newsgroups containing the letter c :o) If these questions are not relevant here, maybe someone could point me to a more appropriate group. Thanks Mark
|
Fri, 04 Feb 2005 14:25:34 GMT |
|
 |
those who know me have no need of my nam #6 / 9
|
 Want to get started in C
in comp.lang.c i read: Quote: >Forgive the basic question, but what is the difference between C and C++? >I know that C++ is object oriented and uses classes, but I relly have no >idea what either of these mean. Is a C++ compiler backwards compatable to >C code? Will the larger IDEs provide functions for both codes? Are there >many fundamental structural/syntactical differences between the languages?
i don't suppose there's any chance you'll read this group's faq, which contains answers to all the questions you posed so far. and if you are somewhat interested in c++ i think you'll find comp.lang.c++'s faq useful too. Quote: >Sorry if this is a little off topic here but it's difficult to search for >newsgroups containing the word "c" as there are thousands of newsgroups >containing the letter c :o)
you need a better newsreader, substrings aren't the only possible search mechanism. -- bringing you boring signatures for 17 years
|
Fri, 04 Feb 2005 17:41:48 GMT |
|
 |
res19j1 #7 / 9
|
 Want to get started in C
Quote: > Thanks everbody for your prompt and helpful replies. Now I know that a > command line interpreter will compile windows applications just fine, I > don't mind using one. It looks like, in order to get GUI building functions > I will need to go with one of the bigger IDEs. Most of the ones I've looked > at are C++ environments. Forgive the basic question, but what is the > difference between C and C++? I know that C++ is object oriented and uses > classes, but I relly have no idea what either of these mean. Is a C++ > compiler backwards compatable to C code? Will the larger IDEs provide > functions for both codes? Are there many fundamental
structural/syntactical Quote: > differences between the languages?
Most big C/C++ compilers support the standard libraries for both C and C++. There aren't a whole lot of differences in the language when it comes to structure/syntax. The C++ standard library provides much more high-level functionality than the C standard library. C++ is also object oriented which allows you to easily reuse components. Most major compilers (such as MS Visual C++) provide their own platform-specific library which is almost always done in C++. The nice thing about C++ is that it's 99% compatible with C code so you can mix the two and make a nice Windows front-end to your exsisting C programs. The best thing about C++'s classes are that you can create a class hierarchy in which one class is derived from another. In MFC (microsoft's foundation classes, which are a set of classes that help with various aspects of windows programming, including GUI development) there is a CView class. It provides a basic view (the white space under the menu and toolbar in simple applications). MFC also provides more specific classes that are derived from CView. An example is CListView. It inherits all of CView's functionality but adds more that implements a list control as your main view. That's just a short overview of how MFC uses C++'s classes. You can also makes instances of classes called objects. Classes are basically structs with lots of extra stuff (not the best comparison, but it works). You can put variables in them as well as functions, just to name a few. If I made a class called CBird, and it had an int variable in it named BirdID, I could make objects of CBird for each type of bird I wanted to record. Example: CBird hawk; hawk.BirdID = 1; CBird jay; jay.BirdID = 5; This is a really basic overview of some practical implementations of the OO capabilities of C++. I personally leraned C++ as my first language and then migrated to C (I still use both) for my current work. I use C++ for almost all of my large applications (as well as most of my Windows programming) and C for more low level stuff (like an Operating System I'm working on). Personally, I reccomend MS VC++. It's the only Windows IDE I have used in the recent past, so I can't make any great comparisons but I got the Standard Edition for like $40 and it has done just about anything I've needed. It also allows you to quickly create forms in a Visual Basic way (drag and drop controls and position them visually). Please let me know if you have any further questions or need more help understanding what I have said. (It's 3:00AM where I am, so my writing might not make a whole lot of sense :-)
|
Fri, 04 Feb 2005 17:59:21 GMT |
|
 |
Malcol #8 / 9
|
 Want to get started in C
Quote:
> > Firstly there is the ANSI C language itself. This is quite a small languge > > with about twenty keywords and maybe twenty operators. I would be > > surprised if Pocket C did not implement this language in the normal way. > It doesn't, actually.
Just shows you should keep to topic and not answer compiler-specific questions.
|
Sat, 05 Feb 2005 02:40:16 GMT |
|
 |
David Thompso #9 / 9
|
 Want to get started in C
Quote: > > 1. A compiler > > Recommendations for a cheap (preferably free!!!) compiler, ideally one > that > > doesn't run in dos mode as I'm running XP so I'm not sure how well a > command > > line compiler would run. A Windows based compiler would be nice. > If you don't mind a command-line compiler (version for Windows, not DOS) I'd > reccomend DJGPP. It's simple to use (gcc myfile.c) and it works great. Just > because it's a command-line program doesn't means that it's a DOS program.
Yes in general Windows command-line programs aren't necessarily DOS, and a COMMAND/Console window is not as often called DOS mode. But DJGPP in particular _is_ a DOS+DPMI program; it runs under real MS-DOS with an extender, or under Win's DOS (with DPMI) emulation. It definitely works fine in W98, and in NT4 except for long file names. I would expect that XP would not be any worse than NT, but the djgpp website and/or newsgroup probably know better. Mingw (www.mingw.org) is the "native Windows" port of gcc tools. It also permits, but does little to assist with, full Win32 (GUI) calls. Quote: > Windows comes with a CLI as well, so a command-line compiler will run just > fine. If you really don't want to type that short bit into a shell then > consider purchasing an IDE such as MS's VC++ (see question 2).
There is an IDE for DGJPP (RHIDE) which I haven't tried. IIRC some obsolete versions of Borland C++ are now available free. And of course there's always emacs <G> in addition to (as you say) MSVC++. Quote: > > 2. A GUI toolkit > > Equivalent of CControls mentioned above, to add GUI building functions. Or > > are these built in to "standard" C? If so how can I find out about them? > There are no GUI components built into standard C. It doesn't even assume > that a monitor is involved. > If you don't mind using a C++ compiler, which will compiler nearly all C > code and you want a set of good GUI controls try using Microsoft's Visual > C++ Compiler with MFC (Microsoft Foundation Classes)
MSVC++ is really both a C and C++ compiler, and in C mode can AFAIK compile any C89 code (modulo bugs, as for any implementation) plus some extensions (again as for almost any other implementation). AFAIK MS hasn't committed to move to full C99, but not too many others have either. MFC is of course available only in C++ mode (or through the normal, clumsy, C++/C interface) and it should be noted is not standard C++ either. Its goodness is debatable, but it is indisputably well suited to Windows. -- - David.Thompson 1 now at worldnet.att.net
|
Mon, 14 Feb 2005 04:19:12 GMT |
|
|
|