Increments inside static char array[] ???

How do i use the ++ and -- increments inside static char array[] variables?

Thanks in advance,

Alan
LVL 5
alanwhincupAsked:
Who is Participating?
 
jhanceConnect With a Mentor Commented:
Or do you mean:

static char c[] = {"1", "2", "3", };

and then want to do:

for(i=0; i<3; i++){
  c[i]++;
}

that will produce c[] = {"2", "3", "4"}

Basically, your question is unclear....
0
 
AxterCommented:
What exactly are you trying to do?

Instead of trying to increment the array[] variable, you should have a second variable, and increment that.

Example:

int index=0
char array[32]="Axter";
do
{
printf(array[index]);
index++;
}while(index<5);
0
 
AxterCommented:
Also it makes no difference wheather the variable is static or not.
0
 
alanwhincupAuthor Commented:
Sorry about the unclear question.. I was in a bit of a rush... I dont know why i even had to ask it ??? Anyways the points are yours jhance.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.