15,551 Topics
![]() | |
I'm implementing a heapsort on a void array. But I'm having trouble with line 6: [code=c]void siftdown(char *start, char *end, size_t size) { char *curr = start; char *child; while (curr*2 + size <= end)[/code] I cast the pointers to char because they have a length of one, and I … | |
plz help me out with the code here thanks, Ravna | |
I read two binary numbers which are separeted by a coma(1010,1000111) from a texfile into two differen linkedlist as below: [code] while (!feof(fout)) { ch=fgetc(fout); if(ch==','){ printf("\n"); control=1; }else{ if(control==0){ if(ch=='1' || ch=='0'){ curr = (item *)malloc(sizeof(item)); curr->val = ch; curr->next = head; head = curr; length1++; } }else{ if(!feof(fout)){ … | |
Does anyone know basic pseudocode for a balanced k-way sort-merge? Thanks for any info you may have. | |
Hi, I'm a newbie to this group. I heard a question in C to swap the two strings using command line arguments but without using the temp. string,pointer or array Can anyone help me how to do this. | |
I have a doubly linked list and I know it gets created with the proper values. For some reason when I run through my print function it, only prints 1/2 of the list and then gives me this: the instruction at "0x7c93426d" referenced memory at "0x00000000". the memory could not … | |
plz tell me abut some gamin and management relating program based on c programming | |
How can I create a C program to delete the internet explorer history file? How can I create a path? | |
can any one write a c program in which both the if and else statements should execute??? | |
Hi, Would anybody know a way to repeat a program, for example the user has reached the end and a prompt is shown on screen Would you like to try again? Press y, n. I have managed to do this using goto command but this as ive read is a … | |
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.... | |
This is different question...can anyone tell...we shld get some text as output hope u can get the question........... dont use any aruments or anything in or on main() we shld juzz keep main() function main() { } dont use C++ or any other..use only C... and this has solution.....frnds help … | |
i just want to know if subscript is greater than the size of array then either this value is stored outside of the memory located to array or sometimes do not saved and poduces error can you tell how and by whom this is decided what action to be taken | |
i develop a database program in c language there the four main contents which are access by using switch statement the each content further has other option which also access by switch but the problem isi n these subcontents last option which is exit. on enter the choice number it … | |
| |
hello guys could you help me with this problem? well you just need to use an array. Write a C program that accepts name,address,age,midterm,&final. then compute for the final rating. Use an array that allows the user to input as many as they want. Your code must display all inputs … | |
Hi, I am looking to upgrade (rewrite) some legacy C programs, and would really appreciate some helpful suggestions on the route to take. i.e. Should it be C++, or C# or .Net or something else? Background ========= Programs: (a) These are MS C v6 utilizing CODEBASE to read Btrieve files … | |
Hello, I don't know bandit_77, but I am also trying to write the exact program that he requested help on. I doubt I know as much as the original poster because I am very new to programming. So the answer to the "goldilocks" problem is, ""Woah, back up Einstein, I'm … | |
Hi. I know C#, but I want to venture out cautiously into the world of unmanaged code (reasons had). Now, I want to learn C++ eventually, but I was thinking that I should learn the C language before, since if I'm not mistaken, C++ is itself an extension of the … | |
Hi friends, i have a doubt, in most of the 16 bit compiler like MSVC1.5, all the far pointers are 32 bit address but they are converted to 20 bit address when accessing data and writing data, how do i tell my compiler to use the 32 bit address as … | |
hi, i have to make a IM program with C and i was wondering if anyone knows a way to access dos commands with C, like net send i was thinking to use rpc (remote procedure call) for windows, so if anyone have any suggestion please let me know |
The End.