15,551 Topics
| |
problem was first posted [URL="http://www.daniweb.com/forums/post1174806.html"]here[/URL]. lionaneesh got a problem with this question. I tried to solve that question myself. He solved himself, but i failed. the questions is: This program/function will delete all those characters in the first string i.e str1[] that matches any character in the second string i.e … | |
[CODE]#include<stdio.h> void squeez(char s[],char z[]); int main() { char s[100] = "Hey wassup !!!!!!"; char z[100] = "Wow cool!!!!!"; squeez(s,z); return(0); } void squeez(char s[] , char z[]) { int j,dummy = 0,i=0; char x[100]; for(j = 0 ; s[j] != '\0';j++)/* the starting loop */ { while(z[i] != '\0') … | |
Error at line 56 and 68. Unable to resolve it. [code=c] #include<stdlib.h> #include<stdio.h> #include<ctype.h> #include<string.h> #include"stack.h" #include"queue.h" #include"calcstack.h" #define MAXSIZE 80 void intopost(stack *stackPtr, queue *queuePtr, char expression[]); void pushvalue(queue *queuePtr, char item); void pushop(stack *stackPtr,queue *queuePtr,char item); void noBracket(stack *stackPtr,queue *queuePtr,char item); void removeBracket(stack *stackPtr,queue *queuePtr,char item); int precendence(char … | |
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; … | |
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? | |
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 … | |
[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; … | |
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 … | |
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, … | |
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 … | |
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 … | |
[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 … | |
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 | |
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. | |
Here is a nice little swap function with a good explanation about what is going on. [url]http://computer.howstuffworks.com/c26.htm[/url] | |
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 | |
| |
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 … | |
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. | |
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 … | |
[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; /************************************************************************/ … | |
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 … | |
| 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() … |
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 … | |
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 … | |
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 … | |
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 … | |
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 … |
The End.