Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Oberon > Re: Of constant...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 20 of 28 Topic 442 of 498
Post > Topic >>

Re: Of constants and variables

by comp.lang.oberon@[EMAIL PROTECTED] Dec 2, 2007 at 11:01 PM

On 2007-12-02, Ulrich <keine@[EMAIL PROTECTED]
> wrote:
> Wenn man in C eine Variable als Feld deklariert, wird sie auf dem
> Stapel angelegt!

No.

> char a[15] ergibt einen Zeiger auf einen zusammenhängenden
Speicherbereich.

This defines a array of char with 15 elements, not a pointer.
Yes, this is very same thing (i.e. same represenation in memory)
as if you define

   VAR a: ARRAY 15 OF CHAR;

in Oberon. The only difference is that in C, »a« does not represent
the whole array but is interpreted as a constant pointer to the first
element (with the exception of the sizeof operator).

> Mehrdimensionale Felder unterscheiden sich in der Reihenfolge der
> Speicherplätze, die man mit der Indizierung anspricht.

There is no difference in Oberon and C for allocating multidimensional
arrays, e.g.

   double matrix[10][20];

is represented the same way as

   VAR matrix: ARRAY 10, 20 OF REAL;

> Prinzipiell unterscheidet sich in beiden Sprachen die Art und Weise,
> wie damit gearbeitet wird, die Strukturen können nicht einfach
aufeinander
> abgebildet werden.

There is no big difference in the structural representation of types
(with the exception of type extensions which are not sup****ted by C). 
The type system is different, e.g. the C construct

   char a[15];
   char* ap;
   ap = a;

cannot be translated to

   VAR a: ARRAY 15 OF CHAR; ap: POINTER TO CHAR;
   (* ... *)
   ap := a;

not just because Oberon does not sup****t »POINTER TO CHAR« (just
pointers to RECORD and ARRAY types are sup****ted) but also because
a is not compatible to a pointer type.

Andreas.
 




 28 Posts in Topic:
Of constants and variables
"Xcriber51" <  2007-10-18 07:05:37 
Re: Of constants and variables
Stefano Ferrari <ferra  2007-10-18 07:36:44 
Re: Of constants and variables
"Xcriber51" <  2007-10-18 11:02:56 
Re: Of constants and variables
pjb@[EMAIL PROTECTED] (P  2008-06-13 20:55:42 
Re: Of constants and variables
Stefano Ferrari <ferra  2007-10-19 01:22:44 
Re: Of constants and variables
Stefano Ferrari <ferra  2007-10-19 01:34:25 
Re: Of constants and variables
"Xcriber51" <  2007-10-19 07:28:00 
Re: Of constants and variables
"Xcriber51" <  2007-10-22 05:41:51 
Re: Of constants and variables
"Chris Burrows"  2007-10-22 22:26:19 
Re: Of constants and variables
"Xcriber51" <  2007-10-22 12:20:08 
Re: Of constants and variables
"Chris Burrows"  2007-10-23 08:58:31 
Re: Of constants and variables
Stefano Ferrari <ferra  2007-10-19 06:09:17 
Re: Of constants and variables
"Chris Burrows"  2007-10-19 23:16:52 
Re: Of constants and variables
=?ISO-8859-1?Q?Christian_  2007-10-19 18:43:54 
Re: Of constants and variables
fmw@[EMAIL PROTECTED] (F  2007-10-19 16:06:35 
Re: Of constants and variables
=?ISO-8859-1?Q?Christian_  2007-10-19 18:33:11 
Re: Of constants and variables
August Karlstrom <fusi  2007-10-21 11:47:08 
Re: Of constants and variables
Ulrich <keine@[EMAIL P  2007-12-02 19:15:58 
Re: Of constants and variables
Ulrich <keine@[EMAIL P  2007-12-02 19:13:44 
Re: Of constants and variables
comp.lang.oberon@[EMAIL P  2007-12-02 23:01:11 
Re: Of constants and variables
Ulrich <keine@[EMAIL P  2007-12-07 00:23:22 
Re: Of constants and variables
comp.lang.oberon@[EMAIL P  2007-12-07 09:47:11 
Re: Of constants and variables
August Karlstrom <fusi  2007-10-21 11:58:00 
Re: Of constants and variables
Ulrich <keine@[EMAIL P  2007-12-02 19:29:01 
Re: Of constants and variables
Stefano Ferrari <ferra  2007-10-21 14:52:20 
Re: Of constants and variables
August Karlstrom <fusi  2007-10-22 17:57:46 
Re: Of constants and variables
Ulrich <keine@[EMAIL P  2007-12-02 19:23:15 
Re: Of constants and variables
fmw@[EMAIL PROTECTED] (F  2007-10-22 10:20:49 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Oct 10 14:49:50 CDT 2008.