15,551 Topics
| |
Hello fellow coders! I am kind of stuck on one aspect of a project that I am currently working on. I have a code for a number guessing game in "C" but I need some assistance as to how to add a "high score" feature to the game. Basically, I … | |
Right, I am attempting to parse a DNS reply, an IPv6 one specifically. The ip is split up into its segments with two bytes used to represent each segment. I have a pointer to the data, currently an unsigned char *c. I have tried simply setting an int to equal … | |
Hey everyone, I'm attempting to write a program that will contain multiple C-DLLs. I currently have 2 structs: [CODE] struct CDLL_Node { char value[30]; struct CDLL_Node *next; struct CDLL_Node *prev; }; typedef struct CDLL_Node node; struct listHolderRecord { char label[30]; struct listHolderRecord *next; node *headAddr; }; typedef struct listHolderRecord listHolder; … | |
Dear all; I want to sort and class the random data by using C programming. The below are example of th data: Diameter Velocity 0.05 1.0 0.05 1.2 0.15 2.2 0.05 1.2 0.25 3.1 0.35 4.3 0.25 3.1 0.35 4.3 0.45 5.7 0.15 2.2 0.15 2.0 I want to get … | |
Hi there, I am fairly new to programming and trying create a program to parse csv data into an array. I have been following an example I found on this site but I am running into a segmentation fault (even if I copy code directly). I am fairly sure the … | |
ok i hope someone can helpme i need display a menu like a presentation page Name Adress Phone using assambly code, but when i put asm{ name db 'homer simpson','$' adress db 'everygreen','$' phone db '555-555', ..... mark unknow assambly code name db ...... I using TC but i need … | |
Hello All, I'm having difficulty detecting the 'LVN_COLUMNCLICK' message from a ListView control. I am entering the WM_NOTIFY for sure, but I can't trap the LVN_COLUMNCLICK. Not sure where else to look, my code seems to follow what is listed on MSDN and just about every snippet I've found. Any … | |
Hello, I am running a heuristic search algorithm (running on Windows XP), and at each iteration, I want to write results in an output file. The issue that I have is that after a number of iteration, my program crashes at the line where I have the "fputs(str, f);" (See … | |
[Code=C] #include <stdio.h> #include <stdlib.h> #define SIZE 5 #define MAX 10 void fillArray(char arr[][MAX]); void printArray(char arr[][MAX]); int fileOpen(void); int main(void) { char arr[SIZE][MAX]; int success; fileOpen(); if (success == 1) { fillArray(arr); printArray(arr); } else printf("File access failed"); return 0; } int fileOpen(void) // ** this were i am … | |
i have 2 executable files. From one of them i'm calling the other one. it is also executed correctly, but does not return 0. why? backup.c file : [CODE] #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/time.h> #include <unistd.h> #include <mysql/mysql.h> int main(int argc, char * argv[]) { if(!execl("/home/user1/exec_work/binary","/home/user1/exec_work/binary","serdar","ilter",NULL)) { … | |
I want to parse a tree the tree is like (((1,2)3,4)5,6) see the attached parse tree the program would produce an array from root to each leaf [URL=http://allyoucanupload.webshots.com/v/2002642992068581724][IMG]http://aycu25.webshots.com/image/35944/2002642992068581724_th.jpg[/IMG][/URL] So I would like to have 4 arrays [CODE] a[]={5,3,1} b[]={5,3,2} c[]={5,4} d[]={6} [/CODE] I would like to have a general format … | |
Can anybody do this; The algorithm of Chang and Roberts achieve the 0(NlogN) (N the number of nodes) complexity of messages in the medium case, but at worst however it achieves 0(n^2). The algorithm of Peterson of/Dolev-Klawe-Rodeh achieves complexity of messages the O(NlogN) at worst situation improving the algorithm of … | |
Hello, i'm a noob C programmer, learning it at university. We have been given an assessment which i need to complete asap. I have figured out the solution to the porgram (almost) but need some assistace. I have a Java and VB background and i cannot seem to get my … | |
[U]Hello...[/U] First of all hello to everyone... this is my first post. I did some 'googling' for help with C code and found this place, the reason I need help is because I am working on a (what I consider hard) project and (only) a week and a half to … | |
I have finished an entire program but there is one small problem with a bit of error trapping. [code] while((((payment/.01)-(floor(payment/.01)))>0.0) || (payment<0.0)) { printf("You can't pay with fractions of one cent! You can't pay with negative amounts! Please type in your payment "); scanf("%f", &payment); }[/code] In this little bit … | |
Hi I want to know about the use of linked list in C and also about its working and syntax. Please tell me about this. | |
in my function OpenData, it corrupts error on memory allocation when I compile and run it. in main, i need to creat an int array and pass it to other function lator.. I take 4 command-line arguments ie, a.out 7 100 lychrels.dat 7 is seed number 100 is number of … | |
the address of the array is contained in the array name that is a pointer to the array it means when we are declaring an integer array a[5] we are getting 10 bytes for the array elements and two bytes for the pointer a? means 12 bytes are occupied in … | |
how to write c code function implementing the first heuristic algorithm [CODE] void binpack_firstfit(int item) { int s = 0; int bin_Value; do{ bin_Value = bins[s]; if (bin_Value + item < BIN_VOLUME){ bins[s] = bin_Value + item; s = NUM_BINS; } }while(s++ < NUM_BINS); }[/CODE] | |
hey I would see on the screen like that UNDER THE mınumum array IT SHOULD WRITE MAX OR MIN WHATEVER YOU CHOOSE for example if we write 2 arrays 3.4 5.6 0.6 8.6 it must write on the screen " Arrays 3.4 5.6 0.6 8.6" MIN MUST WRITE UNDER 0.6 … | |
Hey, what does the following code do? [CODE]#define _ -F<00||--F-OO--; int F=00,OO=00; main() { F_OO(); printf("%1.3f\n",4.*-F/OO/OO); } F_OO() { _-_-_-_ _-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_ _-_-_-_ }[/CODE] I found this interesting question from [URL="http://www.techfest.org/archives/tf07/wired_logic/codemaestros/code.c"]http://www.techfest.org/archives/tf07/wired_logic/codemaestros/code.c[/URL] | |
hello i have a warning error : passing arg1 of srtcmp makes pointer from integer without cast. here is a part of the code : int calc ( char s[] ) { int size = strlen(s) ; int flag = 0 ; char op ; char add[] = "+" ; … | |
i get command-line arguments argv[3], but i need to pass it to function... the sample input would be a.out 7 100 lychrel.dat [CODE=C]int main(int argc, char*argv[]) { int *array, randomNb, arraySize; int i, judge, counter = 0, iteration = 0; int total; if (argc !=4) { fprintf (stderr, "This program … | |
when I call this function in main, I need to convert the 'longlong num' into string and RETURN the string... so in main [code=c] main() { char string[20]; ........ string = LongLongToString(random); } char LongLongToString(long long num) { int counter = 0, i; char string[20]; while(num !=0) { num = … | |
1.main() 2.{ 3. int a=0; 4. while(...) 5. { 6. int a=9; 7. } 8.} now friendz question is question is what make a of 3 global and a of line 6 local what is happend at the time of local decla.. and at the time of global decl... would … | |
Hi all, I need to write a code in C to send AT Commands that to be appear in Hyper Terminal? I need some sample code in C. Plz help. With Thanks Sriram | |
Can we draw graphics on screen by directly pappping the graphics memory using pointers if yes how to find the starting address , word length ,resolusion etc? | |
Can we add two long number using linked list. If Yes then please write a simple code...... | |
is there any method to print a character or string without using ; ? | |
without using swap function.... |
The End.