mattflick this is not complete proper programe. you got many error in it. pointing out the error,
you havn't got the completed main fucntion.
you cant assign a value for an pointer
you cant use shift as an fucntion identifier as it is a inbuilt function identifier
and the proper code for you problem
Code:
#include<stdio.h>
void shiftchar(char *p1, char *p2, char *p3, char *p4, char *p5)
{
char temp;
temp=*p1;
*p1=*p2;
*p2=*p3;
*p3=*p4;
*p4=*p5;
*p5=temp;
}
int main()
{
char c1 = 'A', c2 = 'B', c3 = 'C', c4 = 'D', c5 = 'E';
int i;
for(i=0;i<5;i++)
{
shiftchar(&c1,&c2,&c3,&c4,&c5);
printf("%c %c %c %c %c\n",c1,c2,c3,c4,c5);
}
getchar();
}
/*my output
B C D E A
C D E A B
D E A B C
E A B C D
A B C D E
*/
and the better way of doing this using by string of char(strings)
-ssharish2005