Ur right , i should have not said random combination of clues. Its just combination of a questions and its corresponding clues. But since this is a multiplayer game by 'random combination' i meant a players screen which is visible to the ones beside him/her should have diff a combination. I hope now the requirement is clear!!
User 5495012
Posts
-
Need an algorithm? -
Need an algorithm?I need to write an algorithm for a game. I have a list of questions a list of answers and another list of clues. I need an algorithm to create random combinations of questions and clues, once the question is attempted the corresponding clue and answer becomes void and should not occur again for the next question. I hope iam clear with the requirement!
-
What is wrong in this strcpy()?Even if do not create 'p' and directly copy s to s1, strcpy(s1,s); im still getting the same error.
-
What is wrong in this strcpy()?Even when i change s1 to char *s1="TEMP"; strcpy(s1,p); // resulting in error.
-
What is wrong in this strcpy()?I am sorry for tat. Since i have already set char *s1=NULL; printf("%s\n",s1); // prints NULL
-
What is wrong in this strcpy()?What is wrong in this strcpy()? I tried this function call, no compile time errors, but results in error during runtime. What could be the problem in that function call? char *s= "TEST"; char *s1= NULL; char * s_cpy(char * s,char * s1) { char * p=(char*) malloc(strlen(s)); p=s; printf("%s\n",p); // prints TEST printf("%s\n",s1); // prints printf("%s\n",s); // prints TEST strcpy(s1,p); //error, test.exe has encountered a problem return s1; }
-
How and why does the output vary for pre and post increment operators?How does the output vary for pre and post increment operators? In this code, how and why does value of 'a' vary? main() { int a=0; printf("%d\n",a++); printf("%d\n",++a); } OUTPUT: 0 2 main() { int a=0; printf("%d %d\n",a++,++a); } OUTPUT: 1,1
-
When to use constant variable, and when to use preprocessor/macro constants?I have a question as to when a preprocessor/macro constant should be used, and when a constant variable should be used. Or it would be better if i put it in this way, In a program, when ONLY a macro constant MUST be used and not a constant variable? when ONLY a constant variable MUST be used and not any macro constant?