Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Increments inside static char array[] ???

Posted on 2001-06-28
4
Medium Priority
?
479 Views
Last Modified: 2008-03-06
How do i use the ++ and -- increments inside static char array[] variables?

Thanks in advance,

Alan
0
Comment
Question by:alanwhincup
  • 2
4 Comments
 
LVL 30

Expert Comment

by:Axter
ID: 6234996
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
 
LVL 30

Expert Comment

by:Axter
ID: 6235010
Also it makes no difference wheather the variable is static or not.
0
 
LVL 32

Accepted Solution

by:
jhance earned 200 total points
ID: 6235191
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
 
LVL 5

Author Comment

by:alanwhincup
ID: 6235961
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question