String

#include <string.h>
#include <iostream.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>

#define MaxLen 100

void main()
{

char Wort[MaxLen];
int i=0;
do
{

Wort[i]=getch();
i++;
printf("* ");

}while(Wort[i-1]!='\r'&&i<MaxLen); // '\r'-> carriage return
Wort[i]='\0';
printf("\n");
puts(Wort);

}

<<zurück>>