ehm... sorry, do you mean that the right code is this you pasted here?
the one with j not initialized?
edit is this http://pastebin.com/d2502bcb1 ok?
ehm... sorry, do you mean that the right code is this you pasted here?
the one with j not initialized?
edit is this http://pastebin.com/d2502bcb1 ok?
Last edited by thenewbiecoder; 06-11-2009 at 07:41 AM.
yes, if you put j=0 you'll delete the first product evry time
edit: now it's ok
but:
-line 59 now you can use "product" instead of struct a_product and it's the same for the other part of program in wich you use struct something...
-to do not have ambiguity with the type product and the variable called product i sudgest you to rewrite the structure as follows:
(do the same for city)Code:typedef struct { ... } a_product;
Now you can use a_product as you use int, char and so on...
Last edited by ZaC; 06-11-2009 at 07:50 AM.
Sorry for my bad English
and also for my bad programming style...
ZaC'ZaCoder (?!)
dammit, I didn't even try to delete the 2nd or the third coz the bug was when deleting the first :P
zac I need your help, could you send me a pm?
I can't even access your profile :/
solved it, thanks anyway!
I'm sorry! I was not at home... I'm happy for you that you find the solution alone where was the trouble?
Sorry for my bad English
and also for my bad programming style...
ZaC'ZaCoder (?!)
nothing special, there was a trouble with the project of a colleague but I found a workaround to solve it ^_^
zaaac, where are you?
I'm trying to find a solution to this
C pastebin - collaborative debugging tool
the aim of this function is to create the map (it's a risiko simulation) and to distribute lands to the players; now I'd like to make a map like this
1 1 1 2
1 1 1 2
3 3 2 2
3 3 2 2
but at the moment this function gives me something like this
1 1 1 1
1 1 2 2
2 2 2 2
3 3 3 3
(the numbers indicate the team who owns the land)
it's not a very important matter, I've already sent the project because it works fine, but I think that the first way of generating the map would have been better because it allows player 1 and 3 to play against each other even in the first round of the simulation.
If this program is for the same course, i think that what you wrote is good. To have something like the second you should write a function which try evry assignment until each team region touches the others, and i think this is more than what they ask you
Sorry for my bad English
and also for my bad programming style...
ZaC'ZaCoder (?!)