I guess you were asking me, who started this thread. I use MinGW. and I write in Xemacs.
well. I still have the same problem. I removed scanf . and use only getchar.
I can not get the whole word...
Type: Posts; User: sifeet
I guess you were asking me, who started this thread. I use MinGW. and I write in Xemacs.
well. I still have the same problem. I removed scanf . and use only getchar.
I can not get the whole word...
yes, it does compile! I just maybe missed the ";" sign when copy-pasting. and those unreferenced variables are for the other part of the code which I put comment sign around. and strangely it is not...
sorry :P here it comes the whole program.
(actually not the whole. but I'm still working on this part.)
#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<time.h>
Hey,
This is the part of my code for Hangman game where player make a correct guess and the program should display it as (for ex) _ _ _ s _ _ s _
len is the lenght of the word.
word is the word...
It's working now =D thanks a lot! =)
int main(){
char ch[20];
int i,j;
char* flt[9][20];
FILE *sep;
sep=fopen("hangman.dat","r");
for(i=0;i<9;i++){
for(j=0;j<20;j++){
flt[i][j]= fgets(ch,20,sep);
}
tnx for d reply, but we haven't reached that far i C yet. I mean we haven't learned abt 2D array or allocated memory.
So i'm wondering if there is another easier way to do this.
ok, I'm using fgets now in the code, and I try to save each line (only one word in each line) as an element in the array "flt" . but all elements of the array become the last line/word! I mean they...
Sorry for the wrong title, I can not change it now ! I meant exactly the opposite! :D
anyway...
I know how to use random() or srandom(). My problem is , how to turn the words in the file to...
Hi,
I'm reading from a text file in my code(It's only 10 different words in that). The code should random a word from the text. how do I do that?
Can I somehow turn the text into an array of...
Thanks =)
Hi,
This code is supposed to calculate the dot product of two 3-dimensional vectors.
I get syntax error in line 29. (syntax error before ']' token)
#include<stdio.h>
#include<stdbool.h>...
yepp! I see that now! :"> tnx for the help!
Now I should find out how to use the result of a function in another one. You said this about the variabel slumptal which I used in 2 different...
Hmmmm, I really have no clue! The human_choice function prints the message and this function is the first function in the Main function. still not in a loop ...
although in the function winner I...
Hi again,
I'm still struggling with this code! I used the tips that Mats gave me. Now when I run the program, I write in my choice, computer randoms its choice and then instead of printing the...
I removed them and get no errors no more =) but when I execute the program it's no good!
and it's certainly because of my other mistakes u said.
ok, I'm trying to use the result from the...
Hi,
I'm trying to write a code for the game Stone-Scissors-Paper.
I faced some problems when it comes to announcing the winner. I get a syntax error in line 62.
I'll appreciate it if someone help...
Thanks alot for d answer =)
Hi,
There is this exercise which I have to make an own function in it.
It goes like this:
sum(n) = 1+2+3+...+n
Here is the code I wrote. I get a syntax error in line 14. also an error in line 13...
tnx for d link, very helpful cause I get that problem alot ;) but this time it is not the command window which disappears, it's the program that ends it self ;like if I have a break or sth in the...
ooops! I was being careless forgetting "&" in scanf.
but tnx to your explanations I know now why I should use it =)
but there's another problem too. When the program asks abt the year, It just...
Tnx for the help.
I should have used int instead of float.(right?) cause now I don't get that error longer.
And I used scanf to read "year" instead of getchar. But now I get this error :
"format...
Hi,
This is a program finds out the date for Eastern. I get these two errors when compiling:
-invalid operands to binary % (line 14 and 16)
-int format,double arg<arg 2> (line 19)
I don't know...
Sorry, I didn't even think abt sending my code ! thoughtless done!
Here is the code.
I can't go any further. the only thing I've done here is to get the ascii numbers (in decimal form 0 to 127) I...
Hi,
I'm stuck in two exercises and need help.
The first one is to write a code which prints out the ASCII-tabel. I have no clue on this question.
The second one is to write a code which counts the...