15,551 Topics
| |
i have a function that works for integers. e.g. typedef int Telem; int readValue(Telem *testdata) { if (scanf("%d", testdata)!= 1) return 0; else return 1; } now i converted the integer into a struct typedef struct Telem{ int entrytime; int cust_num; int waitime; }; how will i call this function … | |
Hi all, I am trying to code iterative implementation of bst. But I am encountering some problems as the stack is not updated as it should be. I am getting incorrect output.Some suggestions would be welcomed. [CODE] /*Operations to be performed:- ->Insertion ->Deletion ->Modification ->Search ->Minimum ->Maximum ->Predecessor ->Successor ->Inorder … | |
All I have to do is take an array of n integers and run p threads to sort equally divided p blocks of the same and finally merge them. There is occuring some problem in my code. If I run the threads one by one, by using pthread_join's before next … | |
Hello Sir, I have problem regarding time complexity of any problem, whatever program I make, the time complexity exceeds.Is there any way to reduce the time complexity of the program. If I use two nested for loops, order goes to O(n^2),is there any way to convert this order in O(n) … | |
copy in your program and then run.. [CODE]void Ubaid(int x)[/B] //this is function x value is 5 or directly set x=5 { // x=5; for(int i=x;i>0;i--) { printf("\n"); for(int j=1; j<=i; j++) { printf("%d",j); } for(int u=i-1;u>0;u--) { printf("%d",u); } [B]}[/B] //start another from here that print the opposite for(int … | |
hey.. Ive done a bit of java and im new at C... so forgive the inexperience/noobage here.. I got 2 problems, I want my program to read in 2 fractions and print the product.. and whenever I press enter without entering any value, ie. a null input, I want it … | |
| Hi Folks Is it possible to code a windows GUI application using C? (i.e. not C++) I haven't been able to find an answer on this, trawling thru googlized searches gives me tons of stuff for C++ and C# but not a word about if its even possible with plain … |
Hi, I ve been searching through the forum to find an answer, but have been unsuccessful. My problem is with an integration of an equation. i want to integrate a function say G(w) over w, from the bounds t to infinity. and further i assume that G(W)= F(w1)xF(w2)xF(w3) where F(wi) … | |
*ptr = 'hello world"; if we try to modify the content the result is undefined when i worked with gcc in unix. But i can modify the content in Turbo c. How it worked i got confussed. | |
My contrive s neutral was to determine the hurrying of C compared to C++ (planning languages). I intellection that C++ would be faster, because it was codified many newly. Methods/Materials I utilized two books for testimonial, Herb Schildt's C++: The Staring Write, and Instruct Yourself C++, also by Schildt. I … | |
i cant seem to send my html file through a socket, when vere i connect to the server via web browser [url]http://localhost:7000[/url] it just freezes. and the server stops [CODE] open_ptr = open("/home/user/www/home.html",'r'); while((n = read(open_ptr,buffer,256)) > 0) { n = write( new_sock,buffer,256); } close(open_ptr); return 0; } [/CODE] | |
Stuck on a program i've been trying to work on for the last few hours. A user enters 2 arrays, both are charater arrays with 5 spaces each. They are passed into a function that compares the 2 arrays to each other [I]character by character[/I]. If they are idenital the … | |
int main() { while(1) { doesLove(you); } } doesLove(String str) { printf("I love %s!", str); } | |
can any1 pls tell me how can i solve my problem? i'm running a c program that required the user to key in a int, but instead of keying in int the user key in char... and somehow the program stor the char n turn it into int... some even … | |
I found numerous examples on converting infix expression to postfix expression but my program needs to include some functions like sqrt(x), min/max(x,y), fact(x), abs(x). abs(‐5) is converted to ‐5 abs 120 – (45+3) is converted to 120 45 3 + ‐ (3^2 + 4^5)*fact(3) is converted to 3 2 ^ … | |
Anyone who have experience or any prior knowledge in Image processing (especially using C) please help me..I am looking forward to do a project on 'Video Indexing Using Text Extraction'. I do believe that it can be done by using 'Text Extraction from Images' concept.If anyone have some code for … | |
#include <stdio.h> main() { double fahr,cel; char again; do{ printf("Enter Dgree"); scanf("%lf",&fahr); printf("In Celsius that is %.1lf\n",(fahr-32)*5.0/9.0); printf("agian?"); scanf("%c",&again); } while (again =='y'); } I don't understand why this won't loop any ideas? | |
Hi everybody. I have a doubt in one of the command which is shown below. 1. I created my own adding and multiplication funtion definitions saved in two separate files named "sum.c" and "mul.c". The function calls are present in "main.c" ofcourse. 2. I got the assembler output files by … | |
Hey Guys, first year compsci student and I'm struggling with 2D arrays. Here is my code: [CODE] double classAverage(int assignments, int students) { double average,sum; int row,col; FILE *input_file; input_file=fopen("grades.txt","r"); for (col=0;col<assignments;col++) { sum=0; for (row=0;row<students;row++) { fscanf(input_file,"%lf",&grades[row][col]); while(fgetc(input_file) == ','); sum+=grades[row][col]; printf("%.2lf\n",sum); } } average=sum/students; fclose(input_file); return (average)[/CODE]; int … | |
I have this code but the floats wont print to the file. Everything else prints and works well but the floats i see 0.000. Can someone tell me where im going wrong. I already declare them in the struct as float apaid; float tpaid; [CODE] customer customerinfo(customer info) { FILE … | |
Hi Guys, So I'm trying to experiment with threads, though I'm running into some problems. Basically I'm trying to create multiple threads, where each thread is passed a different set of data. In my small example below, I'm starting off with a vector<string> of data. Each element of the vector … | |
| Hi! I've been googlin' quite awhile now, and I haven't got any luck finding a C GUI library functions and explanations. Do anybody have a link for this? Or even better? a link on pdf file of GUI for C programming? |
I have no idea how can i make a problem..that will run.. can any body help me how to make my project nice..my teacher told me that it was so ugly..she wants me to do like.. when your typing a # it should appear a clue on the correct target..can … | |
the goal is to add, delete, display dota heroes, and display specifics, and exit. thanks!! :) #include<stdio.h> #include<conio.h> #include<string.h> #define N 3 typedef struct{ /*Place fields here.*/ }name; typedef struct{ /*Place fields here.*/ }hero; typedef struct{ /*Place fields here.*/ }hero_info; typedef struct{ /*Place fields here.*/ }hero_rec; void displayMenu(void); void initialize(hero_rec … | |
Guyz, I have been using codeblocks IDE (Latest Version GCC 4.x) for sometime now. For some weeks now Im facing some problem in it. When I build a program for the first time, it runs smoothly. Then I make changes and I build again, then it gives an error saying … | |
Hi, I am trying to pass a string to a MACRO using -D option in gcc. I am not getting desired output, below is snippet, please let me know what I am missing. $ gcc -o finame -D CORE="op1_log.txt" finame.c [CODE] #define STR(x) x int main() { FILE *fp; char … | |
I have to add 2 polynomial equations. Each are stored in linked lists. eq_1 and eq_2 linklists are added and the total is stored in eq_1 linklist. But the problem is when im trying to add both equations, the 2nd for loop(eq_2) is looping once only. I mean when eq_1 … | |
There is a problem I am having inside the AddToEnd function. At this line: [QUOTE]*ptrL->ptrNext = ptrInput;[/QUOTE] it gives this error: [QUOTE]lab8.c: In function ‘AddToEnd’: lab8.c:105: error: request for member ‘ptrNext’ in something not a structure or union [/QUOTE] Can anybody tell me why? P.S. I realized that I do … | |
source base = 2 value = 1001 (9 in base 10) target base = 10 new representation = 9 source base = 16 value = 1FA (4346 in base 10) target base = 8 new representation = 10372E | |
Hello, I am having trouble understanding why I'm getting these errors. a4.c:106: error: expected expression before ‘int’ a4.c:106: error: too few arguments to function ‘ass_average’ a4.c:109: error: expected expression before ‘int’ a4.c:109: error: too few arguments to function ‘ass_min’ a4.c:112: error: expected expression before ‘int’ a4.c:112: error: too few arguments … |
The End.