Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Array Question

Status
Not open for further replies.

qiqinuinaifen128

Programmer
Dec 9, 2007
20
SG
Hi there,

If want to store "MoveForward" in an array, let's say i want to store it at this array X[1000], what command should i use?

Thank for reply^_^

Singapore Swimming Lessons
 
Let's start with the basics:

1. You have to declare the array as an array of some type; ie:

char X[1000];

2. Now assuming you want to store this string "MoveForward" into the array, such that CArr[0] would be "M", CArr[1] would be "o", etc, you would use the following statement:

X = "MoveForward";

or you can combine the two to:

char X[1000] = "MoveForward";



 
Sorry for the confusion; in Item #2, the CArr variable I was talking about should be X, not CArr.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top