z/OS Language Environment Writing Interlanguage Communication Applications
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Signed one-byte character data

z/OS Language Environment Writing Interlanguage Communication Applications
SA38-0684-00

Sample C usage C++ subroutine
#include <stdio.h>

int cplusf( signed char mc );

int main()
{
  int rc;

  signed char myc='c';

  rc=cplusf(myc); /* by value */
  printf("myc=%c rc=%d\n",myc,rc);

}
#include <stdio.h>
#include <stdlib.h>

extern "C" int cplusf(signed char myc);

int cplusf(signed char myc)
{
  myc='d';
  printf("myc=%c, rc=%d\n",myc,myc);

  return((int)myc);
}
Sample C usage C++ subroutine
#include <stdio.h>

int cplusf( signed char *mc );

int main()
{
  int rc;

  signed char myc='c';

  rc=cplusf(&myc);
  /* by reference */
  printf("myc=%c rc=%d\n",myc,rc);

}
#include <stdio.h>
#include <stdlib.h>

extern "C" int cplusf(signed char&; myc);

int cplusf(signed char&; myc)
{
  myc='d';
  printf("myc=%c, rc=%d\n",myc,myc);

  return((int)myc);
}

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014