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


Pointer to character

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

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

extern "C" void cfunc( char * stuff);

int main()
{
  char *mystuff="fun fun";

  cfunc(mystuff);
    /*  by reference */
  printf("mystuff is %s\n",mystuff);

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

void cfunc(char *stuff);

void cfunc(char *stuff)
{
  *(stuff+1)='U';
  printf("stuff is %s\n",stuff);
}

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014