Search:

Type: Posts; User: catasturslykid

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    8
    Views
    605

    Hi Anmol. I don't understand your question at...

    Hi Anmol.

    I don't understand your question at all...

    The following code prints all you want:



    printf("a b c\n");
    printf("h i d\n");
  2. Replies
    4
    Views
    920

    Thanks for the answer, stahta01. The headers...

    Thanks for the answer, stahta01.

    The headers seem OK. Seems like the problem appears while I'm trying to multiply sizeof(Jugada) * tot
    I deleted tot and it works.

    I'm using the libraries:
    ...
  3. Replies
    4
    Views
    920

    Memory error

    Hi guys.

    Check out the following code:




    typedef struct{
    int jugador;
    int cartes[19];
  4. Replies
    3
    Views
    601

    Keep in mind that % is not the same as / 10 /...

    Keep in mind that % is not the same as /

    10 / 2 = 5
    10 % 2 = 0
  5. Replies
    3
    Views
    1,051

    My fault, it's not base 2 haha ...

    My fault, it's not base 2 haha



    strTirades[100] is enough, I think.



    strcpy(strAux,jugador[i].strNom);
    strcat(strAux,"#");
  6. Replies
    3
    Views
    1,051

    You are my last chance

    Ok guys, I know I'm really annoying posting questions every day, but this forum is my last chance to finish my university tasks. I have only 1 more day.

    I need your help with a binary file.

    The...
  7. Replies
    7
    Views
    2,401

    keypressed() returns an int and the int means if...

    keypressed() returns an int and the int means if a key was pressed or not.
    The array key is an array contained in the library allegro, if I'm not wrong.



    So, If I use install_keyboard(),...
  8. Replies
    7
    Views
    2,401

    Ok Crossfire, here is the rest of the code. It's...

    Ok Crossfire, here is the rest of the code. It's part of the main.



    #include "tipus.h"
    int main(void)
    {
    int i = 0;
    int nCorrecte = 0;
    int nJugadors = 0;
  9. Replies
    7
    Views
    2,401

    if (key [KEY_ESC])

    Hi guys.

    I've got one question with allegro and the function key([//Name of the key])

    I want that, if the user press ENTER, the program continues with the execution, but if the user press ESC,...
  10. Replies
    8
    Views
    778

    So, in that case, if strNom is --> char...

    So, in that case, if strNom is --> char strNom[50], I should write:



    frwite(jRanking[j].strNom, sizeof(char), 50, f);


    Right?
  11. Replies
    8
    Views
    778

    The function posaRanking() is called when a...

    The function posaRanking() is called when a player wins the game. Then, the player number (inside the loop, every player has a number asociated to know who is playing ( i = 1 or i = 2 ...etc)) is...
  12. Replies
    8
    Views
    778

    It would be easier with a text file, I think. But...

    It would be easier with a text file, I think. But this is for the university and they said that it has to be a binary file, not a text file.
  13. Replies
    8
    Views
    778

    Here it is: void posaRanking(stPlayer...

    Here it is:



    void posaRanking(stPlayer jugador[4], int i, stPlayer jRanking[5]){
    FILE *f;


    int j = 0;
    stPlayer jAux;
  14. Replies
    8
    Views
    778

    How should I read this file?

    Hi again guys.

    I have to read a binary file with the following structure:



    The sentence before the # is the name of the player and the number after the # is the number of dice rolls that the...
  15. Replies
    2
    Views
    718

    Awesome! Great explanation! Thank you! :)

    Awesome! Great explanation! Thank you! :)
  16. Replies
    2
    Views
    718

    fwrite, how it works?

    Hi guys.

    My question is: How fwrite works?

    If I'm not wrong, fwrite is:



    fwrite( variable, ?, ?, FILE);
  17. Replies
    6
    Views
    751

    No, it's no a strName problem, I write it to show...

    No, it's no a strName problem, I write it to show you that there's a string but that was not the string.

    Here is the code:



    int main() {
    int error;
    int i = 0, c = 1;
    int nCorrecte = 0;
  18. Replies
    6
    Views
    751

    Just changed the code to: for( i = 0; i

    Just changed the code to:



    for( i = 0; i < nJugadors; i++){
    printf("\nNom Jugador %d: ", i+1);
    gets(jugador[i].strNom);
    jugador[i].nColorfitxa = 6 + i;
    ...
  19. Replies
    6
    Views
    751

    Quick question

    Using a gets inside a loop, that's what I see:

    12905

    Here is the loop:



    for( i = 1; i <= nJugadors; i++){
    printf("\nNom Jugador %d: ", i);
  20. Replies
    5
    Views
    1,997

    That was the error. Thank you so much! :)

    That was the error. Thank you so much! :)
  21. Replies
    5
    Views
    1,997

    while(!feof(f))...

    Hi guys.

    I'm having a problem with the lecture of a FILE in Devc++.

    The file is:



    The code I'm using to read the FILE is:
  22. Replies
    12
    Views
    960

    Ok, thank you so much, guys! That was the...

    Ok, thank you so much, guys!

    That was the problem.

    Special thanks to anduril462 for all your help and ideas!

    I have to finish the program in 2 days so, when I deliver the program, I will...
  23. Replies
    12
    Views
    960

    Yes, something happens in assignaCasella because...

    Yes, something happens in assignaCasella because I write "printf("%s: %d: %s: cMode = %c\n", __FILE__, __LINE__, __func__, cMode);" as you said and this is what happens:

    12904

    Here is the...
  24. Replies
    12
    Views
    960

    Ok, I write what you (aldruin) told me in every...

    Ok, I write what you (aldruin) told me in every debug printf and this is what I see:

    12903

    The printf before the last "debugg tool" is not printed.

    And the while(!feof) is the only way that...
  25. Replies
    12
    Views
    960

    oogabooga, here it is: 12902 It's not...

    oogabooga, here it is:

    12902

    It's not finish and it crashes after printing the board (that's something that I have to check out too, because I don't know where it crashes).

    Ok andruil, let...
Results 1 to 25 of 73
Page 1 of 3 1 2 3