Trap representation (was: inside scanf [trap rep])



temper3243@xxxxxxxxx wrote:

.... snip ...

Few more questions
1) Can a variable contain trap representation(trap rep) say a local
variable like int i;

yes

2) Can a pointer contain trap rep ? like say int *p, can p be a trap
rep.

yes

3) Can address of an uninitialized variable every contain trap rep ?
i.e can "&i" contain trap rep

no

4) Can we get to assign trap rep "on a 2's complement machine" ? i.e
int i= value_of_traprep;
printf(" %d",i); will it abort ;

no

5) On a 1's complement machine is trap rep always ~0 or is it
different.

no

When ~0 is trap rep,
what happens,
int i=~0,
printf(" %d",i); will it abort ;

it doesn't happen.


6) How do i get what is the value for trap rep on my arch (i386) .

In general, you don't. There may be many of them.

Don't change the subject without changing the subject line.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>

"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews

.



Relevant Pages