15,552 Topics

Member Avatar for
Member Avatar for c_newbie1

[CODE]#include<stdio.h> #include<conio.h> int main() { int no; scanf("%d", &no); printf("%d %d", no,no++); getch();return 0; }[/CODE] the output of this program is '4 3'.. my questino is WHY? this program should first print the number which is entered.. and then when it prints the next number it should add 1 to …

Member Avatar for c_newbie1
0
135
Member Avatar for Sotiria Sotiria

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 …

Member Avatar for Ancient Dragon
0
586
Member Avatar for gaurav_13191

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 …

Member Avatar for gaurav_13191
0
184
Member Avatar for anurag.kyal

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 …

Member Avatar for nezachem
0
182
Member Avatar for cse.avinash

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

Member Avatar for rubberman
0
481
Member Avatar for Ubiad

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 …

Member Avatar for Ancient Dragon
-5
1K
Member Avatar for thetwig

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 …

Member Avatar for thetwig
0
169
Member Avatar for cayman

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 …

Member Avatar for cayman
0
108
Member Avatar for volkang

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

Member Avatar for volkang
0
165
Member Avatar for harish9

*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.

Member Avatar for rubberman
0
143
Member Avatar for moritz11

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 …

Member Avatar for Narue
-1
224
Member Avatar for moroccanplaya

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]

Member Avatar for moroccanplaya
0
99
Member Avatar for Mal-man

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 …

Member Avatar for darkdai
0
7K
Member Avatar for Grace363

int main() { while(1) { doesLove(you); } } doesLove(String str) { printf("I love %s!", str); }

Member Avatar for harish9
-2
131
Member Avatar for blur blur

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 …

Member Avatar for thekashyap
0
110
Member Avatar for gyuunyuu

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

Member Avatar for thekashyap
0
132
Member Avatar for mja0mja

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 …

Member Avatar for samraj
0
169
Member Avatar for Xeno86

#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?

Member Avatar for Xeno86
0
172
Member Avatar for b56r1

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 …

Member Avatar for rubberman
0
133
Member Avatar for Butum

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 …

Member Avatar for Butum
0
2K
Member Avatar for slygoth

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 …

Member Avatar for gerard4143
0
268
Member Avatar for winbatch

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 …

Member Avatar for anurag.kyal
1
242
Member Avatar for hohoho89

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?

Member Avatar for rubberman
0
174
Member Avatar for Gudger

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 …

Member Avatar for gerard4143
0
81
Member Avatar for amari ♥

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 …

Member Avatar for gerard4143
0
114
Member Avatar for stevanity

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 …

Member Avatar for GDICommander
0
117
Member Avatar for rajeevpareek

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 …

Member Avatar for thekashyap
0
7K
Member Avatar for Kapilxcb

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 …

Member Avatar for jonsca
0
146
Member Avatar for efronefron

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 …

Member Avatar for efronefron
0
187
Member Avatar for hun1905

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

Member Avatar for griswolf
0
124

The End.