Thread: C project

  1. #16
    Registered User
    Join Date
    May 2009
    Posts
    16
    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.

  2. #17
    Lost in the C ZaC's Avatar
    Join Date
    Jun 2008
    Location
    Italy
    Posts
    47
    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:
    Code:
    typedef struct {
    ...
    } a_product;
    (do the same for city)
    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 (?!)

  3. #18
    Registered User
    Join Date
    May 2009
    Posts
    16
    dammit, I didn't even try to delete the 2nd or the third coz the bug was when deleting the first :P

  4. #19
    Registered User
    Join Date
    May 2009
    Posts
    16
    zac I need your help, could you send me a pm?

    I can't even access your profile :/

  5. #20
    Registered User
    Join Date
    May 2009
    Posts
    16
    solved it, thanks anyway!

  6. #21
    Lost in the C ZaC's Avatar
    Join Date
    Jun 2008
    Location
    Italy
    Posts
    47
    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 (?!)

  7. #22
    Registered User
    Join Date
    May 2009
    Posts
    16
    nothing special, there was a trouble with the project of a colleague but I found a workaround to solve it ^_^

  8. #23
    Registered User
    Join Date
    May 2009
    Posts
    16
    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.

  9. #24
    Lost in the C ZaC's Avatar
    Join Date
    Jun 2008
    Location
    Italy
    Posts
    47
    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 (?!)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem Displaying a Struct
    By rockstarpirate in forum C++ Programming
    Replies: 16
    Last Post: 05-05-2008, 09:05 AM
  2. added start menu crashes game
    By avgprogamerjoe in forum Game Programming
    Replies: 6
    Last Post: 08-29-2007, 01:30 PM
  3. Dynamic Binding
    By gpr1me in forum C++ Programming
    Replies: 1
    Last Post: 03-24-2006, 09:01 AM
  4. Game Independent Anti-cheat Project Needs Programmers
    By GIA Project Lea in forum Projects and Job Recruitment
    Replies: 3
    Last Post: 09-15-2005, 07:41 PM