Arrays

Started by
12 comments, last by CoolMiker 23 years, 10 months ago
Can someone give me examples on using arrays in complicated loops? Maybe even have a few pointers here and there?
"The Key To Creation Is Destruction"
Advertisement
What do you mean exactly?
Complicated loops? Hmm, heres one
for( ; ; ); 

Hehe, try that one

OneEyeLessThanNone

That's right, I typed out all that html to get the color effect ... please kill me...

Edited by - OneEyeLessThanNone on June 16, 2000 2:21:01 AM

#define MAX 33

struct xy
{
int nInts;
int *x;
} x[MAX];


........

int j;

for(int i=0;i for(j=0;j {
printf("%d\n",x.x[j]);
}


Visit our homepage: www.rarebyte.de.st

GA

Edited by - ga on June 16, 2000 1:53:54 PM

Edited by - ga on June 16, 2000 1:56:51 PM
Visit our homepage: www.rarebyte.de.stGA
Should it be more complicated??

Visit our homepage: www.rarebyte.de.st

GA
Visit our homepage: www.rarebyte.de.stGA
Why is the code different from the code I posted?? Why don''t I see the ++)??

Visit our homepage: www.rarebyte.de.st

GA
Visit our homepage: www.rarebyte.de.stGA
    for (int j=0; j< 256; j++){   for (int i=j; i>5; i--)   {      for (int k=i-j; i+j < 65; k+=i)      {          cout << "If you tried to figure this out then may god have mercy on your soul" << endl;      }   }}    

now that is complicated


"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
themGames Productions

for (x=1,y=x; y>x*rand(); y,rand()) {
if !x break;
}
ncsu121978, your loop is infinite!!

Visit our homepage: www.rarebyte.de.st

GA
Visit our homepage: www.rarebyte.de.stGA
I meant something useful like how to have people input something, the it is stored in an array. For example, if the typed in numbers it would find the average,times a number was repeated, etc.
"The Key To Creation Is Destruction"

This topic is closed to new replies.

Advertisement