15,551 Topics

Member Avatar for
Member Avatar for mmonaco27

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 …

Member Avatar for mmonaco27
0
296
Member Avatar for ravina_malik
Member Avatar for sivaslieko++

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)){ …

Member Avatar for danzona
0
106
Member Avatar for tat2dlady

Does anyone know basic pseudocode for a balanced k-way sort-merge? Thanks for any info you may have.

Member Avatar for WaltP
0
418
Member Avatar for sathishkumar.e

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.

Member Avatar for Duoas
0
134
Member Avatar for Barefootsanders

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 …

Member Avatar for Barefootsanders
0
95
Member Avatar for rajeev_028
Member Avatar for pedro martinez

How can I create a C program to delete the internet explorer history file? How can I create a path?

Member Avatar for WaltP
0
92
Member Avatar for boyz

can any one write a c program in which both the if and else statements should execute???

Member Avatar for WaltP
0
119
Member Avatar for johnnyjohn20

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 …

Member Avatar for WaltP
0
273
Member Avatar for CaitlynCraft

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 …

Member Avatar for WaltP
1
1K
Member Avatar for e1fjl

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 …

Member Avatar for e1fjl
0
105
Member Avatar for Barefootsanders

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; …

Member Avatar for Barefootsanders
0
93
Member Avatar for marzuki

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 …

Member Avatar for Ancient Dragon
0
85
Member Avatar for matt nagel

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 …

Member Avatar for Duoas
0
7K
Member Avatar for camberos

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 …

Member Avatar for camberos
0
95
Member Avatar for MardukLitzer

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 …

Member Avatar for Ancient Dragon
0
115
Member Avatar for Nemes

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 …

Member Avatar for Ancient Dragon
0
482
Member Avatar for controlsi

[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 …

Member Avatar for WaltP
0
132
Member Avatar for asilter

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)) { …

Member Avatar for Duoas
0
118
Member Avatar for mank

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 …

Member Avatar for Narue
0
108
Member Avatar for funkyjohny

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 …

Member Avatar for Salem
0
156
Member Avatar for r5ingh

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 …

Member Avatar for r5ingh
0
469
Member Avatar for iamconfused

[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 …

Member Avatar for iamconfused
0
218
Member Avatar for deitystrife

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 …

Member Avatar for Duoas
0
90
Member Avatar for adikesan

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.

Member Avatar for rajusankar28
0
124
Member Avatar for enuff4life

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 …

Member Avatar for enuff4life
1
181
Member Avatar for boyz

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 …

Member Avatar for Ancient Dragon
0
269
Member Avatar for kiel19

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]

Member Avatar for Salem
0
142
Member Avatar for spaceintheworld

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 …

Member Avatar for spaceintheworld
0
94
Member Avatar for Jishnu

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]

Member Avatar for Jishnu
0
217
Member Avatar for emilio

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[] = "+" ; …

Member Avatar for Ancient Dragon
0
115
Member Avatar for enuff4life

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 …

Member Avatar for Ancient Dragon
0
79
Member Avatar for enuff4life

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 = …

Member Avatar for Ancient Dragon
0
137
Member Avatar for boyz

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 …

Member Avatar for Salem
0
97
Member Avatar for ssriram

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

Member Avatar for ssriram
0
49
Member Avatar for Jicky

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?

Member Avatar for Salem
0
107
Member Avatar for boyz

Can we add two long number using linked list. If Yes then please write a simple code......

Member Avatar for WaltP
0
102
Member Avatar for boyz
Member Avatar for Jishnu
0
79
Member Avatar for boyz
Member Avatar for boyz

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 …

Member Avatar for doublex
0
92
Member Avatar for boyz

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

Member Avatar for biswajit.bhuyan
0
64
Member Avatar for boyz

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 …

Member Avatar for zandiago
0
91
Member Avatar for boyz
Member Avatar for zandiago
-1
62
Member Avatar for rxylion

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 …

Member Avatar for Ancient Dragon
0
124
Member Avatar for eman resu

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 …

Member Avatar for Ancient Dragon
0
102
Member Avatar for danejar

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 …

Member Avatar for Nick Evan
0
130
Member Avatar for scru

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 …

Member Avatar for Narue
0
82
Member Avatar for tumstech

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 …

Member Avatar for Salem
0
157
Member Avatar for uonsin

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

Member Avatar for uonsin
0
97

The End.