View Single Post
Old 04-15-2008, 09:33 AM   #2
Aeran
Member
 
Join Date: May 2005
Posts: 208
Aeran is on a distinguished road
Re: lpc now, or raw programming later?

C is pretty similar to lpc. Main difference I know from a quick look at lpc is that C:
1. does not support inheritance.
2. uses pointers. E.g "int *test" is not really an array like in lpc, but a pointer to an integer value stored at a specific position in memory.
3. does not use mappings.
4. does not use foreach
5. no string/status/object/mixed/mapping/class datatypes. The class datatype would represent the struct datatype in C. However the syntax to declare a struct is a bit different in C than from LPC, I think. You need to add a semi-colon at end in C, "struct {/*members here*/};"
6. does not use nomask/private/public/varargs keyword-modifiers.
7. does not allow expressions in case-statements of switch. Instead you are only allowed to put constants there.
8. does not use ranges(e.g 1..2).
9. does not use any garbage collector. If you allocate memory manually, you will need to also release it manually(free/malloc functions).
10. +=/-= does not work to concatenate/modify strings/arrays.
11. datatypes such as int|char is not supported. That is an identifier only has one type.

There's probably more differences, but those are the ones I noticed from a quick look at the language. It might also be interesting to consider take a look at C++.
Aeran is offline   Reply With Quote