15,552 Topics
| |
I have built a Canasta card game in MS-DOS and I am now stuck on how create a computer competitor. What I need is someone to tell me how the computer should go about his turn in a four-handed partnership game. This game requires two cards to draw and two … | |
Hello Friends, i am having a hard time coding for **8 Puzzle using DFS** (depth first search). my code uses linked list but apparently its "not ok". so can any1 please help me by sending me a documented code (so i understand). I am kinda on a deadline. -thank you … | |
Hi programmers, i need to have a code to produce a round robin algorithm. Can you help me?? The requirements are that it must have: A menu system with the options (1 input data manually-if option 1 is selected a)to read data from file, b)to enter data by hand, 2-automatic … | |
hi, If I have a union like union Type { struct Student s; struct Employee e; }type; and a struct person like struct Person { char firstname[10]; char familyname[20]; char telephone[10]; union Type type; }p; how can i check whether type of union in person is student or employee?can i … | |
can you help me with my program, actually its already ok but my prof.said that me need to put a rendered money and give the the total change,but when you enter a character just like (a,b,c,d,e,f,g etc..) the change will be higher amount i want it to know how to … | |
I am a little new to C, and i would like to learn how to generate graphics using C. I have been informed that i should use SDL libraries and SDL is dependant on Code::Blocks. but installing them is like walking in a maze | |
I have a question like this. Write a program that reads integer from keyboard. If I enter a negative number it return a negative number. If all the numbers I enter are positive numbers then return the average of these positive numbers. Can someone help me out this problem? Thank … | |
please send me SAMPLE grid follower code for ATMEGA8 BOARD | |
hi i want To Write a PhonBook program in c which will accept a Name and a Number from the User an save them in a struct, the problem is how to create a new structure name every time : here is the could , though its not work but … | |
Hello. I am a beginner. I have searched the past threads, but I haven't found any help. My assignment says to write a function to swap 2 values using pointers. Write a main function that inputs 2 numbers. Have it call the swap function if the numbers are NOT in … | |
My Program is about Directed Graphs. It reads a list of edges like : `25 589` , and puts 589 into the adjacency list (a linked list) of 25. My input file has about 5 Million such `v w` edges, with about 800K nodes/vertices, for each of which there will … | |
Hi. I have a question about one function in my program. Write a function that will replace players in a tim. New player gets in the game, and takes the place of one that leaves. Prototype of function is: void replace(TEAM *p,PLAYER newplayer,int num) where second parameter is new player, … | |
| I have a question about game programming with c. I should add a background music on my game, and the same time i want to move my character on it. i used that way for solution PlaySound("sample.wav",NULL,SDN_SYNC); playing music ok but i cant move my character... |
Hi. How to find index of first letter in every word in a string? For example, input string is: Programming Languages. Output should be: 0 12, those are the indexes of letters "P" and "L". I tried different approach, to print those numbers but that didn work. Thanks for the … | |
Hello , I found this puzzle : typedef struct { int dd[ 5 ]; int tx; } node; node * A = new node[ 10000 ]; for ( int i = 0; i < 100000; i++ ) { for ( int j = 0; j < A[ i ].tx; j++ … | |
Hi. I need help finding the longest word in a string. How to return last longest word if there are two or more words with the same (longest) length? My code: #include <stdio.h> #include <string.h> int main() { char string[100], word[20], max[20], min[20], c; int i = 0, j = … | |
I have just started developing and writing linux kernel modules and device drivers. I am having a lot of trouble understanding new data types that I haven't encountered while writing application programs. For instance, I am having difficulty understanding what is the purpose of size_t, ssize_t, loff_t etc? Why use … | |
Hello!!! I am trying to get my program to run in Visual Studio 2012, but it won't. I keep receiving errors on my brackets, such as missing function header or 'expected a declaration'. I knew they were messed up from the start, but I just can't seem to get it … | |
Alright can you guys tell me why the first call to printOcean prints out the memory address of the arrays rows/cols and the second one prints like its suppossed to with 0's which the array is filled with #include <stdio.h> #include <string.h> //macro #define FLUSH_STDIN(x) {if(x[strlen(x)-1]!='\n'){do fgets(Junk,16,stdin);while(Junk[strlen(Junk)-1]!='\n');}else x[strlen(x)-1]='\0';} //define constants … | |
#include<stdio.h> int factorial (int); void main() { int a,fact; printf("\nEnter a value:"); scanf("%d", &a); fact= factorial(a); printf("Factorial value=%d", fact); } int factorial (int x) { int f=1,i; for(i=x;i>=1;i--) f=f*i; return(f); } Enter any number: 3 Factorial value = 6 But i did not undartand this program. Mostly in the loop … | |
I have a few questions about libraries and header files. Since libraries are binary files and header file are source/text files why do they not just compile the header files along with the rest of the library files? It doesn't make sense to me to have libraries that are binary … | |
Goodmorning guys, I'm trying to compile a simple SDL project with gcc in mac OSX Maverick... This is my main.c file: #include <stdio.h> #include <stdlib.h> #include <SDL/SDL.h> int main( int argc, char *argv[]) { SDL_Init(SDL_INIT_VIDEO); printf("Grande!\n"); SDL_Quit(); return 1; } In facts my function do nothing but I just want … | |
#include<stdio.h> #include<conio.h> void main() { textbackground(BLUE); textcolor(WHITE); clrscr(); gotoxy(30,9); printf("Welcome to"); gotoxy(30,10); printf("Program2Do"); getch(); } It is a simple color chnaging C program. I had run it on Codeblock. But got error in this line: textbackground(BLUE); | |
Hello all, I am implementing linked list programs in C. And for that i want to know more about Self Referential Structure in C. If anyone knows more detail information about it then please tell me. I am having one example here which helps you to understand more clearly what … | |
Why the following printf of the buffer in the readWav() causes segmentation fault just after printing the first row to the screen? Are there any issues with the use of pointer in printf("%d\t %f\n", i, *buffer[i]);? #include <stdio.h> #include "sndfile.h" int readWav(const char *const fname, long *numFrames, int *sRate, float … | |
Hi, I need to use getopt for a program called like myprogram.c file1 file2 file3 -t. Now I've read some examples about how to use switch cases for options with hypens (-t). But I don't get how to write this for my file1, file2, and file3 (they are arguments that … | |
What is the output for the code - void main() [ int i=4,x; x=++i_+_++i_+_++i; printf("%d",x); ] | |
I am doing this assignment for my computer science course, and I have to write a function that determines if 'x' can fit into an n-bit, two's complement integer. I am not allowed to use any control statements or operators other than the [ICODE]! ~ & ^ | + << … | |
Hii All, i am a begginer at c programming in the first semetser of study, and i am trying to doing my project what is: Diff — The program should compare two text files and list the differences, i.e. lines and columns of the beginning and the end of a … | |
Filter and process data Download the file population.txt from webcourse. The file is a formatted text file with 3 columns: country, city and population. Read the file and create a short c program to do the following: a.display the name and the population of the city with the highest population … |
The End.