Solved

Increments inside static char array[] ???

Posted on 2001-06-28
4
471 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
White board coding practice 3 95
Issues with C++ Class 19 107
object oriented programming comparison 5 86
HTTPSendRequest with WinINet delays on first call 11 81
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

749 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