Topic: NULLing a pointer and INT 0x1c


Author: amorgan@csd-d-5.Stanford.EDU (Crunchy Frog)
Date: Mon, 5 Oct 1992 23:43:14 GMT
Raw View
In article <92279.185945KSADEGH@auvm.american.edu>
  Kayvon Z. Sadeghi <KSADEGH@auvm.american.edu> writes:
>Hi guys,

Salutations.

>1- how do you change the value of a pointer passed to a subroutine? It seems
>to me like you can do almost anything with it except changing the value
>to NULL. This is what I mean:

Let me ask you a question: I have a frobznick.  How do I change the value
of the frobznick in a subroutine?  I pass a pointer to it.  How, then, do
I change the value of a pointer?  I pass a pointer to that pointer.


main()
{
  int *fred;

  changeMe(&fred);
}

changeMe(int **thing)
{
  *thing = NULL;
}

I have no idea on your second problem.

C Frog




Author: Kayvon Z. Sadeghi <KSADEGH@auvm.american.edu>
Date: Mon, 5 Oct 1992 18:59:44 EDT
Raw View
Hi guys,

If this is not the right place to ask this just skip this, but compare to what
I saw in this group, I thought this should be the right group.
I have two problems:
1- how do you change the value of a pointer passed to a subroutine? It seems
to me like you can do almost anything with it except changing the value
to NULL. This is what I mean:

pass(struct something *p){
         p=NULL;
}

main(){
      struct something *apointer;

      pass(apointer);
}


I tried everything, but no success.


2- I am using the intrrupt 0x1c to print something in graphic mode.
Something like this:


void interrupt pr(int x,int y){
     disable();
     outtextxy(x,y,<the time>);
     enable();
}


main(){
setvect(0x1c,pr);
.
.
.
}


But, it crashes after a while. Eventhough, the time is printed at the right
coordinate, the system apparently goes down. My guess is that I have to
somehow, save the registers before getting into the pr and restore them after
getting out. But I can't figure out how.


Any help is appreciated.

k1
---
------------------------------------------------------------
KAYVON Z. SADEGHI                  K.SADEGHI@IEEE.ORG
VOICE: 202/244-0789