Thread: Homework Help (Array loop?)

  1. #1
    Registered User
    Join Date
    Feb 2013
    Posts
    14

    Homework Help (Array loop?)

    Hey, back again, trying to figure out how to make a mancala program. For the incrementing part of this program, I don't know how to write this function. I want to increment an array from x to y. If the number of times I'm incrementing is greater, the array has to loop back to x. Anyways to do this?
    Code:
    int P11(int x[]){	int i;	int j;	int num = 0;	x[2] = num;	x[2] = 0;		if(x[i] == x[7]){		continue;	return x[7];}
    This forum is squeezing all my stuff together for some reason.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Try using "paste as text"
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Homework Help (array)
    By IamTheCarter in forum C Programming
    Replies: 9
    Last Post: 10-14-2011, 08:51 PM
  2. Homework Help C Program Loop & Switch
    By 123456tacos in forum C Programming
    Replies: 7
    Last Post: 03-11-2011, 08:11 PM
  3. array homework
    By kokujampo in forum C Programming
    Replies: 4
    Last Post: 04-05-2010, 12:47 PM
  4. homework help. cant get for loop to count right
    By bluegoo06 in forum C++ Programming
    Replies: 11
    Last Post: 03-10-2005, 06:05 PM
  5. A while loop?? homework..tips please.
    By ftblstr2319 in forum C++ Programming
    Replies: 13
    Last Post: 03-26-2004, 08:31 AM