Pointers in C/C++
P | N


#include <iostream.h>

void show_string(char *string)

{

while (*string != `/0')

{

cout << *string;

string++;

}

}

void main(void)

{

show_string("Hello, World!");

}

Can also be written:

while (*string)

{

string++;

}

Or

even:

while (*string)

cout << *string++;


Previous | Next


Last modified at 8/5/97; 1:30:06 PM
Other Links of Interest
College of Computing | EduTech Institute | GVU Center
Mark Guzdial | Papers | CS 2390 Spring '97 Home Page | STABLE | MMC-CaMILE

Slide Master