Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 135,921 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,583 people online right now. Registration is fast and FREE... Join Now!




new array

 
Reply to this topicStart new topic

new array

kckc314
11 May, 2008 - 01:05 AM
Post #1

D.I.C Head
**

Joined: 5 Apr, 2008
Posts: 128

if i have an original 12 x 12 array square grid, i need to search each element in the square grid, how do i create another array with the same size and keep track of the coordinate points that i have been visited so that i can easily check which points i have been visited in the if statements later? thanks in advance.
User is offlineProfile CardPM
+Quote Post

no2pencil
RE: New Array
11 May, 2008 - 01:08 AM
Post #2

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 6,433



Thanked: 64 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

code.gif

QUOTE

how do i create another array with the same size

... I would think that this is fairly simple. Or maybe I just mis-understand what you are asking.

cpp

#include <stdio.h>

#define MAX 256

int main(void) {
char array1[MAX];
char array2[MAX];

printf("The size of both arrays is %d\n",MAX);
return 0;
}


If you define your MAX size, then it'll always be the same value, as long as you use it when defining the array. Again, I think this is what you're asking, yes?
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/1/08 08:10AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month