home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
OTHERUTI
/
TCPP10-7.ZIP
/
EXAMPLES.ZIP
/
INTRO32.C
< prev
next >
Wrap
Text File
|
1990-09-26
|
494b
|
24 lines
/* INTRO32.C--Example from Chapter 4 of Getting Started */
#include <stdio.h>
int main()
{
char name[40];
char number[10];
char *str_ptr = name;
int pos, num_chars;
printf("Enter a string for the character array: ");
gets(name);
printf("How many characters do you want to extract? ");
gets(number);
sscanf(number, "%d", &num_chars);
for (pos = 0; pos < num_chars; pos++)
printf("%c", *str_ptr++);
printf("\n");
return 0;
}