Code:
#include "..\ownh.h"
#include "..\stdio.h"
int main (void)
{
/* Input of String-array *
char mystring [21] ;
printf ("fill in a string: ");
scanf ("%s",mystring);
printf ("The string you entered is: %s\n",mystring);
/* Rotation of string */
while (waarde1 > 0)
{
printf ("Rotation: %s\n",mystring+waarde1);
waarde1 = waarde1--;
}
printf ("%s",uitk);
pause ();
return 0;
}
waarde1 = waarde1--; is unnecessary, just having waarde1--; will do the same thing.
Not sure about your #includes, what kinda compiler you using and on what OS?
printf ("%s",uitk); is also not going to work, uitk is never defined ever. For that matter neither is waarde1.
What exactly is this rotation? Your trying to reverse a string right?
Heres an example of what I would do.
Code:
#include <stdio.h>
#include <string.h>
#define MAX 21
int main(void) {
char string[MAX];
int size;
printf("Give me a string foo: ");
scanf("%s", string);
printf("String entered is: %s\n", string);
size = strlen(string);
printf("Here is string in reverse: ");
while (size >= 0) {
printf("%c", string[size]);
size--;
}
return 0;
}