15,551 Topics
| |
I need help writing a program that randomly picks a point in a 2D space. Then the user will be allowed to make repeated guesses which point was picked with feedback saying if the user is hot or colder on each guess. Thank you! | |
here is my code [CODE=C] #include<stdio.h> #include<conio.h> #include<string.h> int main() { char A1[100], A2[100],c[100]; int n1,n2,i,j; printf("Enter string A1:\n"); gets(A1); printf("Enter string A2:\n"); gets(A2); n1=strlen(A1); printf("%d ",n1); n2=strlen(A2); printf("%d ",n2); char *p1=A1, *p2=A2, *p; p=(char*)malloc((n1+n2)*sizeof(char)); for(i=0;i<n1; i++) { *(p+i) = *(p1+i); } for(i=0; i<n2; i++) { *(p+n1+i)=*(p2+i); } int k2=strlen(p); … | |
Hello I want to send a dns packet to a dns server. I've already connected to the dns server but not able to send the packet in the right wy. Actually I don't know how to send? Here's the code.. [CODE]#include <winsock.h> #include<stdio.h> #include<string.h> #include <io.h> #include <sys/stat.h> int main() … | |
Hello, I am new to C and am in need of some help. I am getting a warning, assignment makes pointer from integer without a cast. here is some parts of my code: struct BOARD { char *theBoard[8][8]; }; typedef struct BOARD Board; int main(int argc, char *argv[]) { Board … | |
Well, im a beginner programmer, trying to make my own proggy in Dev C++ but i have massive problem with dialog, this doesnt work (using mdi example): mdi_unit.h [CODE]#define CM_WINDOW_TILEVERT 9084 #define CM_WINDOW_TILEHORZ 9083 #define CM_WINDOW_ARRANGE 9082 #define CM_WINDOW_TILE 9081 #define CM_WINDOW_CASCADE 9080 #define CM_EDIT_PASTE 9079 #define CM_EDIT_COPY 9078 #define … | |
Hi, I have been trying to read the data from a file, which looks like this, for some hundred rows: y x1 x2 x3 x4 x5 -1.120448885 1 0.333799767 0.488337281 -2.011297473 -0.097103584 1.981332002 1 -0.559282628 -0.775806971 1.739534174 -0.900925792 5.955490161 1 1.618560385 0.242730629 1.008987835 -1.092595567 here is the code I am … | |
I got problem with this function for adding icon to a program with small programs it corupts it and with bigger programs it doesn't even do anything [code] #include <stdio.h> #include <windows.h> #define MIN 2 char *ReadFile(char *SzFile,int *BytesCount) { int fSize; FILE *pFile; char *Buffer; if(!(pFile=fopen(SzFile,"rb"))) return NULL; fseek(pFile,0,SEEK_END); … | |
Hello guys, I am doing a small C/C++ program(mainly for use in my father's work - Includes a batch processing inside a folder which is repetitive). I just need to find the number of files in a folder(not necessarily of a single filetype). What I thought was using [ICODE]system("dir > … | |
How can we get the last error occured in linux. suppose there is a connect() func error in that case how to get the error that occured. | |
Hey Guys, I'm trying to read individual characters from a file, store them in two arrays then print out the arrays. The input file looks something like this 7 1 5 0 1 2 4 3 7 0 2 5 9 0 3 With the first number being the length … | |
Can anyone help me with doing problem 12 on project euler? The question is asking which triangle number has more than 500 factors. The first few triangle numbers are: 1, 3, 6, 10, 15, 21, 28 ... Hope you understand the pattern, cause a can't explain it in words vary … | |
Hey I have a text file (1.txt) with the lines: This is line 1 This is line 2 This is line 3 This is line 4 This is line 5 and Im trying to read all the pair lines from that file and write them to another text file called … | |
Hi there! I need to write a function called intersect so that the program i have determines if 2 circles intersect. The first circle has centre (px,py) with radix pr and the second circle has centre (qx,qy) with radix qr. I have no idea how to go about with this … | |
Where can I find sample client-server program using poll. Or if someone has it can they share it. | |
Hi im writing a program in C that will find the prime factors of a number. When i compile it and put in a number i dont get any thing Any idea what i did wrong in my code? #include <stdio.h> int main() { int n, k; printf("Enter the number … | |
Hi all, Here's the problem I have. clock() call returns 0 no matter when I call it.... Code: [CODE] #include <time.h> #include <stdio.h> #include <math.h> int main() { volatile double n, i, x; clock_t time1, time2, time3; int j; // while (time1 < 1) time1 = clock(); for (i = … | |
Hi, if any one has the idea of the internal system calls which gets activated by using high level statements ( like printf ,scanf or malloc and so on) please provide me the links or any related info. i have an idea that the internal system calls depends on the … | |
hi to everybody on this most helpful programing board I have trouble setting up Dev C++ compiler,I have a lot of errors in 100% right code so I guess that compiler isnt set right. I want to work in C. here's example: [URL=http://img27.imageshack.us/i/111111af.jpg/][IMG]http://img27.imageshack.us/img27/4492/111111af.th.jpg[/IMG][/URL] | |
Hello friends and gurus, this is my first post here. i have few basic C questions. is sizeof an opearator(i actually studied it as a operator but then not so serious about the things) 1.why is it called as an opeartor? 2.sizeof is compile time operator. what does that mean … | |
Hi, Has someone got a code of skip list(in link list). Skip list is a list through which we can do binary search in a link list Thanks.... | |
hi...i have a project to do which simulates a calculator, quiz and chat session....i finish writing my code but i have no idea how to write the pseudocode since classes and functions are involved....can someone pls give me an example of a pseudocode that has both functions and classes cuz … | |
Howdy, I have an assignment which requires that I get user input for 3 different variables, each in it's own function. These three functions are called by another function, which is called by main to begin with. Each of these inputs have a range that the input must be in. … | |
Hey guys. Started C a couple weeks ago and I'm trying to learn how to implement functions. I need to make a function which returns a 1 if its a prime number and 0 if it isn't. This is the pseudo code given to us and I'm having trouble constructing … | |
I have a treeview in my program for which I am adding a bitmap of an open and closed folders. I have included messageboxes to show where the program fails. It fails at the loadbitmap function. I appreciate it if anybody can tell me what is wrong. Below is the … | |
Dear. everybody. when i progress the developing some functions using mysql db with vc++2005, i have the following problems i connected mysqldb and i runned the query to insert some records to my table in the DB, but i cant success in inserting. my sample code is followed as : … | |
Hi. I'm trying to debug a program that was written in Aztec C. I would like to use a familiar environment like VS2005. Is there any way to make VS2005 use the Aztec C compiler commands (from Aztec BIN folder)? If not VS2005, is there some way I can debug … | |
i would like to know the way we can make user enter a number in a menu reply perhaps so that he doesnt have to press the enter key...........i.e. the program automatically proceeds with the give value and doesnt wait for an enter key to be pressed. its easy in … | |
I have the doubt on eof concept,so please explain that with some example,............ | |
I was given homework to write a program that finds if a double (64 bit) is negative. The double uses twos complement, so the first bit will tell if it is positive (0) or negative (1), but you all probably know that. The problem I am having is that there … | |
How to implement "Linear canonical transformation" in C language |
The End.