turbo c

K

khan

hi this is yousaf shah.. student no: 091304
my quistion is...........
what is pointer in turbo c...?
 
S

Sjouke Burry

khan said:
hi this is yousaf shah.. student no: 091304
my quistion is...........
what is pointer in turbo c...?
You are a pointer to an instance of the genus "lazy student".
In TurboC such a pointer can cause irreparable damage to education.
 
S

spinoza1111

hi this is yousaf shah..   student no: 091304
my quistion is...........
  what is pointer in turbo c...?

Ak-salaam aleykum. A pointer in turbo C, or any C, is the actual
address of the value in a "Von Neumann" stored program addressible
machine such that every variable has a sequential address. This makes
C rather different from other "high level languages" which conceal
this value. However, the machine could theoretically be not Von
Neumann because C does NOT allow one to take the address of a C
"instruction", although entire functions may be passed as parameters.
 
S

spinoza1111

You are a pointer to an instance of the genus "lazy student".
In TurboC such a pointer can cause irreparable damage to education.

No, he's a human being. He and his mates may be having a chortle at
the expense of the regs here who cannot (owing to their lack of
computer science literacy) in fact answer these questions.
 
S

spinoza1111

int (*p)(void) = main;

p is a counter-example to your claim, since it is a pointer to a
function, not a value.

Thanks, Otto. Please do not be too disruptive today.

Function pointers are less a counter-example and more an inelegant add-
on, but correct, Otto, they constitute an extra type of pointer which
does not constitute a pointer to a value (a series of instructions) to
which C has access. Actually, it should have access to the actual
compiled function's machine instructions.
If you mean that C allows entire functions to be passed as parameters,
you are mistaken. Pointers to functions may be passed, but functions
themselves cannot.

OK, I don't, Otto. I wouldn't want to be mistaken. I'm not a reg who
gets to make mistakes on the order of Seebach's boners.

The point is that you are so afraid of "being wrong" (there existing
some interpretation of your words such that it's "wrong") you can't
answer simple questions.
 
S

spinoza1111

There's nothing in C which implies sequential addresses
for different variables.

On my machine, if I declare only two one byte size variables,
char a = 0;
char b = 0;
they wind up with 3 unused bytes in between them.

/* BEGIN new.c output */

&a is 0012FF7C
&b is 0012FF78

/* END new.c output */

/* BEGIN new.c */

#include <stdio.h>

int main(void)
{  
    char a = 0;
    char b = 0;

    puts("/* BEGIN new.c output */\n");
    printf("&a is %p\n", &a);
    printf("&b is %p\n", &b);
    puts("\n/* END new.c output */");
    return 0;

}

/* END new.c */

OK, replace "sequential" by "ordinal".
 
B

blmblm

[ snip ]
OK, replace "sequential" by "ordinal".

Not that it matters, but I'm not sure that really helps -- I mean,
in a system where an address consists of a segment identifier and
an offset into the segment (and as best I can tell that would be
AOK with the C standard), is there really any meaningful way to
order pointers from different segments?

Just sayin', maybe.
 
S

Seebs

Not that it matters, but I'm not sure that really helps -- I mean,
in a system where an address consists of a segment identifier and
an offset into the segment (and as best I can tell that would be
AOK with the C standard), is there really any meaningful way to
order pointers from different segments?

Not really, especially because on many systems, there is substantial
overlap, such that you can have two different {segment, offset} pairs
which actually refer to the same byte of memory.

-s
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Turbo C 1
Turbo C 3
String in Turbo C 2
Turbo C 2.0 1
Turbo c 1
C++ Programming Searching for Good Way to Learn 2
[OT] Conjectures? on the "constant pointer on Turbo C programming"junk 12
Turbo C Strange Problem 12

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top