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");
Type: Posts; User: catasturslykid
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");
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:
...
Hi guys.
Check out the following code:
typedef struct{
int jugador;
int cartes[19];
Keep in mind that % is not the same as /
10 / 2 = 5
10 % 2 = 0
My fault, it's not base 2 haha
strTirades[100] is enough, I think.
strcpy(strAux,jugador[i].strNom);
strcat(strAux,"#");
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...
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(),...
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;
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,...
So, in that case, if strNom is --> char strNom[50], I should write:
frwite(jRanking[j].strNom, sizeof(char), 50, f);
Right?
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...
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.
Here it is:
void posaRanking(stPlayer jugador[4], int i, stPlayer jRanking[5]){
FILE *f;
int j = 0;
stPlayer jAux;
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...
Awesome! Great explanation! Thank you! :)
Hi guys.
My question is: How fwrite works?
If I'm not wrong, fwrite is:
fwrite( variable, ¿?, ¿?, FILE);
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;
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;
...
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);
That was the error. Thank you so much! :)
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:
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...
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...
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...
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...