18,491 Topics

Member Avatar for
Member Avatar for khan001

plz help me in this code . its not giving the output plz correct my code [CODE]#include <stdio.h> int main() { double fahr , celsius; printf("Enter the temperature in degrees fahrenheit:"); scanf("%d",fahr); //convert to celsius celsius = (5.0 / 9.0) * (fahr - 32.0); printf("%if temperature in celsius",celsius); return 0; …

Member Avatar for mitrmkar
0
158
Member Avatar for johndoe444

I see this in KR C programming language. I really did not understand what it means. If it is line number of current source then we could use __LINE__. But what is the use of #line actually?

Member Avatar for Ancient Dragon
0
129
Member Avatar for piyushhbk
Member Avatar for COKEDUDE

I'm going through my professors notes right now and he says in big bold print "Length does not include terminating null". I've looked at 2 different versions of this and in both cases it counts the terminating null. Can someone explain why this is happening. Case 1 [CODE]#include <stdio.h> #include …

Member Avatar for daisy192
0
162
Member Avatar for konata_89

[CODE]#include <stdio.h> #include <conio.h> #include <stdlib.h> #include <string.h> #define TRUE 1 #define FALSE 0 void new_item(); void list_item(); void search_item(); void buy_item(); void list_buy_item(); struct item { float price; char item_name[20]; int n_item; struct item *ptrnext; }; struct item*headptr, *newptr, *currentptr,*previousptr,*headptr2, *newptr2, *currentptr2,*previousptr2; void main() { char ch; int choice=TRUE; …

Member Avatar for Luckychap
0
146
Member Avatar for Unidennn

Hi, i have to write a program: user inputs a string of characters (letter, digits spaces etc any possible charachter) and then the program should calculate how many letter, digits, spaces, and other characters are there. I did this question using just a char array and then for loop with …

Member Avatar for Unidennn
0
143
Member Avatar for blackrobe

Hey, How can I terminate a server after some number of connections (don't want it to keep on running forever). I've written in it C, using the select system call, and an array to store the connections made in.. [CODE] while (1) { FD_ZERO(&rdset); FD_SET(clients[fd], &rdset); ( select(max+1, &rdset, NULL, …

Member Avatar for nezachem
0
195
Member Avatar for COKEDUDE

Can someone please explain why this function will not compile. [CODE]#include <stdio.h> #include <string.h> #include <ctype.h> // This function determines if a string is a palindrome. /* This function reverses the characters in the string * passed by the caller. */ void is_palindrome (char* string) { int i; int length …

Member Avatar for Narue
0
196
Member Avatar for johndoe444

I noticed typing in shell like man printf shows a man page entry. Usually there are man pages for each command. I mean man pages are supposed to be for APIs and external interfaces (like g++, etc). How did the internals of say the c standard library functions end up …

Member Avatar for gerard4143
0
121
Member Avatar for QuantumMechanic

I am hoping someone here can help me with a little bit of trouble using the execve() call. I have some code that needs to call an external script under CNL (Compute Node Linux, [I]i.e.[/I] - Cray XT4/XT5). CNL is [B]extremely[/B] lean and is missing enough libraries to make using …

Member Avatar for QuantumMechanic
0
1K
Member Avatar for nupurashi

[code] void main() { int a = 5 , b =6, c=0; c = a++ + b++ + ++b + ++ a + a++; printf("c = %d \n", c); getch(); } [/code] the result of the code is c = 32 while if we write the following code the result …

Member Avatar for WaltP
0
128
Member Avatar for prade

hiii....i done some graphics programming on a turbo c compiler & i would like to link it to a front end...& may be even develop a gui out of it....please tell me the procedure to link a turbo c code to a front end

Member Avatar for jwenting
0
92
Member Avatar for junezy4

I need the coding for the following question in C: Read from a file (.txt file) and count the number of times the word "a", "is", "the", "and", "that", and "this" occurs.

Member Avatar for targ2002
-3
150
Member Avatar for pumba

Hi all, I am tryin to differentate an equation and solve using C or C++. I need a start, n i m not getting much information from web even..I am curous hw MATLAB does that...i m positive that LAPACK has a no subroutine for differentiation. Appriciate your response Thank you

Member Avatar for Nick Evan
0
141
Member Avatar for COKEDUDE

Here is a nice little swap function with a good explanation about what is going on. [url]http://computer.howstuffworks.com/c26.htm[/url]

Member Avatar for Narue
0
108
Member Avatar for vkspune

hi its vijay here. i have a problem asked in interview on bit wise operator. question: take a input int var=0xaabbccdd; write a program to reverse it so the out put will be var=0xddccbbaa; please reply me as soon as possible. regards viajy sheoran

Member Avatar for WaltP
0
46
Member Avatar for COKEDUDE
Member Avatar for WaltP
0
957
Member Avatar for Moneek89

I have no idea where to begin. 1. Write a collection of fuinctions to do arithmetic with rational numbers(common fractions). Define functions getRational, displayRational, addRational, and subtractRational whose prototypes are: void getRational (int& numer, int& denom); void displayRational (int numer, int denom); void addRational (int& ansNum, int& ansDenom, int num1, …

Member Avatar for BestJewSinceJC
0
75
Member Avatar for Etherwind

I wrote a function to read an expression (i.e. A+B-C) from the keyboard one character at a time, and ignoring spaces insert each char into a queue. I tried something I though would be fairly elegant, but I don't think I did it right. This is my function: [code] void …

Member Avatar for WaltP
0
114
Member Avatar for junezy4

I need the coding for the following question in C: Read and print all the consonants from a file (no duplicates). Assume the file is a .txt file. The consonants are then to be sorted in alphabetical order.

Member Avatar for Ancient Dragon
-6
186
Member Avatar for TimCereja

This displayBits function works fine in this code in displaying the bits of the input integer. I put the same thing into function reverseBits and have been trying different things to get it to reverse the order, but can't seem to get it right. I think it's a minor modification …

Member Avatar for TimCereja
0
683
Member Avatar for lionaneesh

[CODE]#include<stdio.h> int lcm(int a,int b); int main() { int a; int b; printf("Enter two numbers to find lcm of ? :-\n1. "); scanf("%d",&a); printf("2. "); scanf("%d",&b); printf("%d is the lcm of %d and %d\n\n",lcm(a,b),a,b); getchar(); return(0); } /******************* FUNCTION *****************************/ int lcm(int a,int b) { int i,g,pr,z,q,dummy,lc = 0; /************************************************************************/ …

Member Avatar for Ancient Dragon
0
128
Member Avatar for Soileau

I am getting many many warnings of this kind in my code. It comes every time I typecast something in my code, which I am doing to variable addresses in order to use integer arithmetic on them. How do I fix these warnings? Thank you! I would appreciate any constructive …

Member Avatar for gerard4143
0
2K
Member Avatar for Member #454440

I'm using Dev-C++ 4.9.9.2 Im making my arrays dynamically and I am calling on a function to allocate the memory for me, but I received the warning: "[Warning] assignment makes pointer from integer without a cast " This occurs in main when [B][COLOR="Red"]alocate [/COLOR][/B]is called Main funtion: [code=C] int main() …

Member Avatar for Member #454440
0
154
Member Avatar for ChrisXxX
Member Avatar for mikabark

I'm doing school assignment. But I can't solve it yet. Will you help me? Using shared memory,I have to copy structure to second program. But it does not operate well. Maybe it's type problem especially shmat part. Will you help me guys? Thanks you in advance. [CODE]struct work_list { int …

Member Avatar for Ancient Dragon
0
414
Member Avatar for RandyWhite

I am experiencing a rare problem. I wrote a program in C that creates several windows and I use them to load and display images. After using the program for a while loading and displaying images then all of a sudden all the windows on the desktop disappear including the …

Member Avatar for mitrmkar
0
146
Member Avatar for khan001

i m new in c language. i write the following code. its not giving the correct input. when i enter the marks it always give ouput "F" .please correct the code [CODE]#include <stdio.h> void main() { int marks; float percentage; printf("enter marks:"); scanf("%d",&marks); percentage=(marks/1100)*100; if (percentage>80) printf(" A+ "); if(percentage …

Member Avatar for jephthah
0
154
Member Avatar for akssps011

I have created a graph(map) using graphics.h in C. Just to mentioned I have coordinate location of each and every point on the map. How can I zoom in to the particular area selected by the user ? Secondly, how can I zoom in around a particular point(selected by the …

Member Avatar for WaltP
0
105
Member Avatar for saulocpp

Hi all. First post on the forum. I'm writing a generic funtion to open files along my program, but am worried if the pointers are being closed correctly. The function definition: [code=c] FILE* openfile(char *FileName, char *Mode) { FILE *TempFile; if((TempFile = fopen(FileName, Modo)) == NULL) { fprintf(stderr, "Couldn't open …

Member Avatar for jephthah
0
207
Member Avatar for Rmitboy

Write a function that reads an integer n and several lines of text (sentences between 150 – 200 characters). The text will be printed n characters per line, by adding extra spaces as evenly as possible. For example: Enter an integer (maximal number of chars per line): 10 Enter some …

Member Avatar for Adak
0
153
Member Avatar for dondajr

Well, here i am one more time. In previos post I asked here about read files. All of those problem were fixed, but now, i really have a problem that I don't know why is happing. In the first , i need to explain what my system will do: My …

Member Avatar for dondajr
0
107
Member Avatar for ROTC89

ok so i am making a program that has a master slave process. the master sends out the 2-d array which is 1000 by 1000 to the slaves. then the slaves calculate the sums of the rows sends back to the master who sums it all up. then the time …

Member Avatar for jonsca
0
1K
Member Avatar for Colin Mac

I have this C program with multiple files and I want to introduce a new file called enemy.c. and I'm wondering if I'm going about this right. game.h [code] #ifndef GAME_ #define GAME_ extern void game (void); extern void enemyFunc (void); extern int enemyPosX; #endif [/code] main.c [code]int main (void) …

Member Avatar for virgoptrex
0
212
Member Avatar for bohongtw

hi there i have an assignment about writing Cshell with some features i m not gonna ask plz gimme the codes or smth. but i need some advice how to start writing it, what to do maybe smn can show me ways to do it , thanks for help here …

Member Avatar for Aia
0
187
Member Avatar for emilyhedgecock

Hi I am making an mp3 database at the moment and i have run into some difficulty when passing down the array to a function. I can do it when i create the array globally as obviously this means i dont have to pass it down, but i want to …

Member Avatar for Banfa
0
1K
Member Avatar for en12ic0

Hi, I'm trying to create a simple distributed system model in C where a central controller regulates the communication between several machines. The controller's job is firstly spawning client process in several hosts. In my understanding to do this you needs to have a connection with the target host but …

Member Avatar for jephthah
0
101
Member Avatar for ChrisXxX

Can anyone shoe me an example code to encode an entered password in C. for example: password=vista when displayed to the user on screen when entering the password it should look like this ***** Can someone show me how this can be done, thanks

Member Avatar for jephthah
0
87
Member Avatar for dondajr

Hi guy, i have this little program: [CODE] #include <stdio.h> #include <stdlib.h> #include <time.h> #include <string.h> #include <unistd.h> //Obtem o nome do buffer de trade baseado na hora char *btfile() { char *fname; fname = malloc(14); time_t t = time(NULL); struct tm *lt; lt = localtime(&t); strftime(fname, 14, "%m%d%H%M.tbf", lt); …

Member Avatar for dondajr
0
165
Member Avatar for Valdemar009

Hi Everyone, I'm really fed up of working on C in Windows Vista. First and foremost, the window of C occupies only half the screen which is very annoying. I've heard that there is a distinct C that is used with Vista but I have failed to attain any more …

Member Avatar for jephthah
0
187
Member Avatar for oggiemc

Can someone please tell me what im doing wrong in this program..im gettin a compiler error saying: C:\Dev-Cpp\projects\proto.cpp In function `int main(int, char**)': 46 C:\Dev-Cpp\projects\proto.cpp a function-definition is not allowed here before '{' token 46 C:\Dev-Cpp\projects\proto.cpp expected `,' or `;' before '{' token C:\Dev-Cpp\projects\Makefile.win [Build Error] [proto.o] Error 1 The …

Member Avatar for oggiemc
0
139
Member Avatar for ellaine101591

We have an assignment to convert infix to postfix. And I have made this initial code. When this program is executed, I'd type any word that is not an operator or '(' or ')'. For example my input is "asd" my output should be "asd" also. But in this code …

Member Avatar for emilo35
0
251
Member Avatar for sam_dev

hi every body....... here i want to ask something about base64 algorithm which is used for the encryption of passwords.........i just want to know that how it works ?????what are the functions used in this algorithm?????any type help.....any link...????

Member Avatar for jephthah
0
130
Member Avatar for ganesanronaldo

hey guys... Thanks for your help in my previous post. Havin another problem in my stack assignment this time.. Have done how much i could but there is a lil error in it.. Possible in the [B]convertip[/B] function... Hope i can get the help needed.. Thanks in advance...=) [CODE]#include <stdio.h> …

Member Avatar for ganesanronaldo
0
166
Member Avatar for DrueY

Hi there, Could someone give me a simple of example of how to write code in a c++ class library file? I made this to include through a reference in a c# app file. This is what Ive tried but Ive gotten all sorts of build errors: [CODE]// CClass.h #pragma …

Member Avatar for Banfa
0
282
Member Avatar for TimCereja

I've been trying to read all I can about the %n conversion specifier, but I'm having trouble with it. In the following code, I generate ten random numbers between 1 - 1000 and save each to an element of the array. I need to use %n to keep a running …

Member Avatar for TimCereja
0
108
Member Avatar for priyankapandey

[CODE]#include<stdio.h> #include<conio.h> void** printA( int* , int ,int[][]); void printw(void*, int ,int); void main() { int num[3][5] = { {1, 2,3,4,5}, {6,7,8,9,10}, {11,12,13,14,15}, }; int* num_ptr[3]; void** ptr; printf("traversing by double pointer"); ptr=printA(*num_ptr,3, num); printw(* ptr, 3, 5); } void** printA(int* num_ptr[],int r,int num) { int i,j; for(i=0;i<r;i++) { *num_ptr[i]=num[i][0]; …

Member Avatar for priyankapandey
-3
79
Member Avatar for aianne

Hi! I need help to my Turbo C program.. I need to create a program that will ask the "Starting X:", "Starting Y:", Ending X:", and Ending Y:" on different shapes.. this is how the program should be: [CODE]SQUARE: starting X: starting Y: ending X: ending Y: CIRCLE: Starting X: …

Member Avatar for Top9ne
0
1K
Member Avatar for rsg31

Hi, i have this letters, A,R,V,G,M,N,B. And from those i need to get 4 of them randomly, bit i dont know how to do it, please help! :D

Member Avatar for thomas_naveen
0
217
Member Avatar for churni

hi guys, i'm frustrated at my piece of code for a heap sort function. i believe everything is correct but i am a hardcore beginner at c. i have made a rand.txt file with some floats in it in the form; 91.175598 68.562500 96.664803 29.593500 43.156502 34.241001 59.178200 85.542702 81.852798 …

Member Avatar for IsharaComix
0
112

The End.