18 May 2007, 14:20 | #1 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
*** edited by DamienD, link to old thread; Graphics converter - RAW to source ***
@Zetr0 - Hmmm, interesting stuff... Just how portable is C and how many different flavours are there? Would I be able to learn a bit of C on one platform and then write routines that would work (within reason) on any other platform? Last edited by DamienD; 18 May 2007 at 23:21. |
18 May 2007, 14:25 | #2 |
move.w #$4489,$dff07e
Join Date: Sep 2005
Location: Norfolk, UK
Age: 42
Posts: 2,351
|
Oh yes That's pretty much the point of C. You can write generic routines and then just recompiled them (unaltered) on other system - sweet
|
18 May 2007, 14:27 | #3 |
Ya' like it Retr0?
Join Date: Jul 2005
Location: United Kingdom
Age: 49
Posts: 9,768
|
@pmc
... how portable is c.... ???? C is the most portable language there is !!!! as long as your stuff uses the standard libraries (theres a lot of 'em) then its as portable as well... a simple compilation... there is a limmitation though... if you use asm_inline statements then this will have to be changed depenedent on cpu ie. 68000 and x86 are as you know substantially different. hiting the hardware is also arkward to convert. but memory, personal routines and io is all easly portable!!! C is awsome.... clearly.... its the one language to controll them all!!!! |
18 May 2007, 14:31 | #4 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
@musashi5150 & Zetr0 - Nice. What's the difference between all these C+ and C++ and Visual C versions then or are they the same? Is there one that's regarded as more 'standard' that would be best to learn with and what would you recommend as a good starter for a complete beginner?
Ooops! - this one started off as a request for an app and now its drifted into a coders discussion - hope it's still in the right thread! Last edited by pmc; 18 May 2007 at 14:36. |
18 May 2007, 14:42 | #5 |
Ya' like it Retr0?
Join Date: Jul 2005
Location: United Kingdom
Age: 49
Posts: 9,768
|
The syntax is pretty much the same.
C+/C++ & Visual C (all being the same) *visual C is microsoft implementation* C++ has support for clases (you dont need to use them btw) but they are more effcient than structs etc. C++ also has better memory handling routines inbuit with the use of "new" and "delete" typedefs. Over all C++ is what I can honestly is the best coding platform to work from. |
18 May 2007, 14:49 | #6 | |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
Might have to give that one a miss then! Any suggestions for good C++ editor / compiler packages on Amiga / PC? How about decent 'C++ for muppets' type books - should be at about my level! Last edited by pmc; 18 May 2007 at 15:38. |
|
18 May 2007, 15:01 | #7 |
Ya' like it Retr0?
Join Date: Jul 2005
Location: United Kingdom
Age: 49
Posts: 9,768
|
i love the muppets, my favorite one is beaker. i recomend C++ from the ground up third edition ISBN- 0-07-222897-0
|
18 May 2007, 15:09 | #8 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
@Zetr0 - you sir, are a gentleman - thank you very much. My favourite muppet's Animal btw...
|
18 May 2007, 20:58 | #9 | |
Registered User
Join Date: Dec 2002
Location: California
Posts: 965
|
Quote:
|
|
18 May 2007, 22:27 | #10 |
Citizen of Elthesh
Join Date: Sep 2003
Location: UK
Posts: 949
|
For learning C++, I would recommend Thinking in C++ by Bruce Eckel, which is available online for free on his homepage.
I'd like to point out that while at first glance, C++ is just C with some extra features, it represents a very different philosophy. You'll want to look into the principles of object oriented programming (Wikipedia link) to really understand what C++ is all about. The differences between different modern C/C++ compilers are generally rather small. For portability you might want to look into using the GNU Compiler Collection, which contains (among other things) both C and C++ compilers and is available almost everywhere (on many different architectures and for many different operating systems, including Amiga). Microsoft Compilers have been known to have slight differences, but I believe nowadays it's not so bad anymore. So if you want a really nice development environment for Windows, you might want to look into Visual C++ 2005 Express as ant512 suggested. As for C and C++, there are two major C standards, being the old ANSI C and C99. While ANSI C is almost a subset of C++ (in that a C++ compiler will compile almost all ANSI C code), C99 has developed independently a bit. However, many compilers hide some of the differences from you. There is only one major C++ standard at this time, which is C++98 (although it got some bugfixes and enhancements in 2003). A new C++ standard is currently being worked on and is expected to be released "before 2010". All that said, these things only have minor effects on every-day work, and especially on learning the basics of the language(s). The actual languages (C/C++) only have a small number of features, so it's all about libraries, which don't change all that much at the very core either. So if you start learning C/C++ you don't really have to worry about the different standards way too much. If you've worked mainly with assembly language, C will probably feel more natural to you than C++, but you might want to look into some of the cool stuff that you can do with an object oriented language. Maybe a mod could split this thread and move part of it into the Coder's Heaven forum? |
18 May 2007, 22:38 | #11 |
Citizen of Elthesh
Join Date: Sep 2003
Location: UK
Posts: 949
|
While I'm at it...
A bit more about the relationship between C and C++.
About using libraries and interfacing with other languages. You can link any C library against a C++ program and use its functions without problems, the reverse is not true, because C++ has a lot of internal magic (calling class constructors/destructors, name mangling for overloaded functions, etc. -- don't worry if that doesn't meany anything to you yet), which a C program could not easily invoke (there are ways to use C++ libraries from C and other C-like languages, but it's messy). So in short, from an "available libraries" point of view, C is best for writing libraries, C++ best for using. Of course that's far from the only thing to consider, but it's something. |
18 May 2007, 23:07 | #12 |
move.w #$4489,$dff07e
Join Date: Sep 2005
Location: Norfolk, UK
Age: 42
Posts: 2,351
|
I use C++ on a daily basis at work and it's a good language for 'modern' app development.
I would say though that C is an excellent partner to any assembly programmer. Not only will it help you out reading lots of the system documentation, but you can 'sketch' out your code in C sometimes before getting down to the nitty gritty in Asm. One example for me is with various packers I've coded. I always code them in C first and get them working good etc. Then I code a nice optimised decruncher in 68K afterwards (with decrunch stripes of course ). That's just me though... |
18 May 2007, 23:32 | #13 |
Registered User
Join Date: Jul 2001
Location: Malayasia
Age: 43
Posts: 657
|
Just learning C++ myself. Like eLowar I would recommend "Thinking in C++" - a very useful book.
I use the Bloodshed Dev-C++ IDE - its not perfect but I much prefer it over Visual Studio myself. Much smaller footprint too. Its download comes with the Mingw32 compiler package. |
18 May 2007, 23:40 | #14 | |
Citizen of Elthesh
Join Date: Sep 2003
Location: UK
Posts: 949
|
Quote:
MinGW32 is a Win32 port of GCC btw (for those who don't know and in reference to my earlier post). |
|
19 May 2007, 01:43 | #15 |
Music lord
Join Date: Jun 2003
Location: Liverpool, UK
Age: 50
Posts: 630
|
I would always recommend going to C++ and totally bypassing C if you've never done either before. Otherwise, you'll end up learning the bad habits of C, and possibly putting them in your C++ code. C++ is a great language. If you use it in the way it was intended (very type-safe), the code you produce will be very robust. I can't remember the last time I had a bug that was due to a coding error (as opposed to a logic error).
I would also highly recommend Visual C++ Express. It's a bit of a pain to setup, though, to write "normal" Windows apps as the default install really wants you to code for .net. You have to download the Platform SDK for Windows Server 2003, and then change a few config files to make it use the right libraries. But if you can get past that hurdle, it's the best there is and it's totally free. The debugger can't be beaten (it's got good heritage: the debugger team was run by Andy Pennell, who wrote Devpac). The editor can though. I use Vim. There's nothing faster once you've clambered up the intensely steep learning curve. I can't ever go back to a standard editor. |
19 May 2007, 01:56 | #16 |
Citizen of Elthesh
Join Date: Sep 2003
Location: UK
Posts: 949
|
I would personally agree, I think the very minor overhead that C++ introduces is very well worth its benefits. But I'm trying not to discriminate against C.
Thinking in C++ is a good book in that it directly sends you in the right direction, avoiding bad C habits. I'm not going to start discussing editors here, because that's just bound to derail the thread. Suffice it to say that most decent editors these days have syntax highlighting for C/C++ and other support for the languages (e.g. function lists, auto-completion, etc.). |
19 May 2007, 01:59 | #17 |
Ya' like it Retr0?
Join Date: Jul 2005
Location: United Kingdom
Age: 49
Posts: 9,768
|
.... sigh... i miss the code warrior ide.....
there are a ton of IDE's and Compilers it all depeneds on what ya platform your building on.. I have noticed no one has mentioned IBM's free IDE that can be used as a C++ or Java development platform. I used this a fair bit and i have to admit i found it quite powerfull have a search for "Eclipse" primarly released for java it has extentions for C++ I run .net studio here and its pretty damn treats you like a king. *(except for a few anying project debugging bugs LOL but there are ways arround that)* |
19 May 2007, 02:00 | #18 |
Citizen of Elthesh
Join Date: Sep 2003
Location: UK
Posts: 949
|
Didn't mention Eclipse because I don't like it for C++.
It's most excellent for Java though. |
19 May 2007, 02:02 | #19 |
Ya' like it Retr0?
Join Date: Jul 2005
Location: United Kingdom
Age: 49
Posts: 9,768
|
@eLowar
Indeed its most excelent for Java! there are better for C++ but hey.... its free |
21 May 2007, 11:06 | #20 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
@everyone - I've not been to EAB for a couple of days so I missed all this good stuff till now... Thanks for the information chaps! You're all top boys.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
A few questions | Muzer | project.ClassicWB | 10 | 12 September 2009 14:14 |
Questions... | Jeeva | Amiga scene | 5 | 04 April 2008 23:45 |
Three Little Questions. | mindjoker | support.Hardware | 2 | 16 March 2003 03:38 |
Two questions | Drakon | request.Old Rare Games | 7 | 19 November 2002 19:33 |
A few questions! | One1 | New to Emulation or Amiga scene | 2 | 30 October 2002 17:41 |
|
|