K
khan
hi this is yousaf shah.. student no: 091304
my quistion is...........
what is pointer in turbo c...?
my quistion is...........
what is pointer in turbo c...?
You are a pointer to an instance of the genus "lazy student".khan said:hi this is yousaf shah.. student no: 091304
my quistion is...........
what is pointer in turbo c...?
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.
int (*p)(void) = main;
p is a counter-example to your claim, since it is a pointer to a
function, not a value.
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.
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".
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?
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.