15,547 Topics

Member Avatar for
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
105
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
144
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
126
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
128
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
164
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
166
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
98
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
74
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
142
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
97
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
38
Member Avatar for COKEDUDE
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
99
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
164
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
561
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
107
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
1K
Member Avatar for Zach101man

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 Zach101man
0
134
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
351
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
115
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
135
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
85
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
187
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
129
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
86
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
180

The End.