Solved

Increments inside static char array[] ???

Posted on 2001-06-28
4
465 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 50 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

863 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

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now