Search:

Type: Posts; User: Covalent

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    995

    Wow thank you! So stupid mistake.

    Wow thank you! So stupid mistake.
  2. Replies
    2
    Views
    995

    Warning for a pointer of structure

    Hey, so I have this here:



    char *item;

    item=&fact[numero].transactions.items[k].noItem;


    'noItem' is a char too. For some reason, the program is doing as expected, the good value is read...
  3. Replies
    6
    Views
    1,196

    OK I fixed it. Here is the final solution :P (The...

    OK I fixed it. Here is the final solution :P (The printf is there to see where the while stops to be sure it stops at the right spot)


    void ajouterFacture(Caisse* caisse, Items* inventaire, int*...
  4. Replies
    6
    Views
    1,196

    Yes I know! I tried "0", '0' and plain 0, but...

    Yes I know! I tried "0", '0' and plain 0, but when I try the NULL one, k is just not the good answer (it returns me 10, but I'm expecting something like 4-5)

    And if I put NULL or 0, I get a...
  5. Replies
    6
    Views
    1,196

    Well, yes, at the very start of the program...

    Well, yes, at the very start of the program (sorry if I didn't explain it), my structure is filled by reading a .dat that contains all the informations of the inventory and then the already existing...
  6. Replies
    6
    Views
    1,196

    Reading structures

    Hey, so I'm doing a little work with structures. It's a simulation of a shop. Here are the structures:


    typedef struct
    {
    char noItem[LONG_CODE]; // le numÈro de líitem
    int...
  7. Replies
    6
    Views
    2,357

    Well sorry, I meant a full keyboard that included...

    Well sorry, I meant a full keyboard that included too 0 to 9 ^^'
  8. Replies
    6
    Views
    2,357

    And what if I know it's a keyboard with numbers...

    And what if I know it's a keyboard with numbers from 0 to 9? :P
  9. Replies
    6
    Views
    2,357

    Issue with scanf and char

    Hi,

    So I get this simple thing here, meant to get a number between 1 and 12. The problem is, in my program, if I enter a character, I get an infinite loop and I just can't find a way to fix it....
  10. Replies
    16
    Views
    1,930

    I did meant /1000000000 but now that you're...

    I did meant /1000000000 but now that you're telling it, I'm not sure it's the best option.

    I changed it for modulo 10 and it's quite well working. Wow, really thank you all! But now still I got...
  11. Replies
    16
    Views
    1,930

    Ok I just forgot to add srand(time(NULL)); in my...

    Ok I just forgot to add srand(time(NULL)); in my declaration. Still, every 12 digit number I get only has 0-1-2, never something else...
  12. Replies
    16
    Views
    1,930

    Ok, I renamed and it's working, thank you! And...

    Ok, I renamed and it's working, thank you!

    And I saw what you meant by "what you will get will be interesting", I corrected the &d in the printf for %d.

    But now, I always get the same numbers,...
  13. Replies
    16
    Views
    1,930

    But if I write while (rando!=9), wouldn't that...

    But if I write while (rando!=9), wouldn't that make loop my function until I do get a 9?




    Here is my code corrected.


    #include <stdlib.h>
    #include <stdio.h>
  14. Replies
    16
    Views
    1,930

    Wow, yes, that ; after the while indeed fixed a...

    Wow, yes, that ; after the while indeed fixed a lot of things! Thx for that!

    The while (rando=9) is there so the random generation number continues until I get a number else then 9.

    For your...
  15. Replies
    16
    Views
    1,930

    Yeah well, I know it would be better, but we just...

    Yeah well, I know it would be better, but we just can't use Arrays, specification in the homework ^^' Else I would have done that :P Same thing for character chains, we can't use them.
  16. Replies
    16
    Views
    1,930

    Various errors with pointers

    I'm trying to do a program that randomly generates 12 digits, not equal to 9, using pointers. But I get some pretty nasty errors and I just can't understand what's wrong. I'm using XCode on Mac OS X....
Results 1 to 16 of 16