15,551 Topics

Member Avatar for
Member Avatar for sidrules1984

Please suggest why is it giving a run time error as "non portable type conversion" ptr=popen(system(command),"r"); what should be done? thanks

Member Avatar for Radical Edward
0
78
Member Avatar for otttt

Hi Could somebody help me with my homework. Use functions and structures. Strings in input file 'AND', 'OR' ja 'NOT' must be replaced with symbols '&', 'v' ja '-' and saved into output file. Example of input: C = A AND B D = A OR C E = NOT …

Member Avatar for thekashyap
0
461
Member Avatar for yashsaxena

Hello All I have on prog. in C which displays the text file in reverse order. I was in thinking that for text file reverse order means displaying text from end of file to beginning of file. in the same image will be rotated in 180 degree i.e. reverse the …

Member Avatar for yashsaxena
0
109
Member Avatar for sidrules1984

char exe_str[]="find E:\sid -name 'sid.txt' -print"; How do i make find command here interactive... 1st. Accept the Drive letter from user 2nd Accept the file name from user thanks..

Member Avatar for thekashyap
0
183
Member Avatar for shakisparki

Hello , Please what does the second typedef statement do, [code] struct listnode{ char data; struct listnode *nextPtr; }; typedef struct listnode Listnode; typedef ListNode *ListNodePtr; [/code] what is the difference between [code] ListNodePtr *sPtr; and ListNodePtr startPtr; [/code] Please explain what the second Line of Code would do please …

Member Avatar for Adak
0
143
Member Avatar for Kirbyzdashiznit

Write a C program in to calculate the parking fare for customers who park their cars in a parking lot when the following information is given: A. A character showing the type of vehicle : C for car, B for bus, T for truck. B. An integer between 0 and …

Member Avatar for chrjs
0
407
Member Avatar for moroccanplaya

i am writing a web server thats serves one html file but when i go to my browser and type in localhost:50000/home/user/www/index.html i get something like this  viewd on my browser heres my code for writing to a socket [CODE] n = read(connectfd, buffer, 255 ); if (n < …

Member Avatar for dondajr
0
101
Member Avatar for dondajr

Hi everybody o/. I'm studing Linked List in C. I made two functions: add ( add data on the list) and destroy (destroy the list). For now, it's just this two functions that i need, but the function destroy doesn't works well. When I call the function destroy only the …

Member Avatar for dondajr
0
268
Member Avatar for shinsengumi

Hi all. Is there a command in C that can delete a string contained in a longer string and then replace the deleted string with another? Big thanks to those who can help me with this.

Member Avatar for Adak
0
581
Member Avatar for Kirbyzdashiznit

Write a C program in to calculate the parking fare for customers who park their cars in a parking lot when the following information is given: A. A character showing the type of vehicle : C for car, B for bus, T for truck. B. An integer between 0 and …

Member Avatar for rubberman
-2
3K
Member Avatar for Incubator

I just learned about Recursive functions and they seem very confusing to me, and hard to trace the logic, sometimes i end up staring at it pretty much time to understand the logic, so i can write it. So, i was wondering if there are some simplified steps i could …

Member Avatar for rubberman
0
114
Member Avatar for udinnet

I made my own program for N-queen problem (A popular algorithm in Data Structures). Check this code and post your suggestions. If you have any ideas for the improvement of algorithm speed, please post here. Thanks. [CODE] #include <stdio.h> #include <stdlib.h> //N-Queen Chess problem solving Algorithm// //Note:- Uncomment The printf("") …

Member Avatar for Adak
0
517
Member Avatar for london-G

hello, I am building an application where I have two integers and I have to add them or multiply. I have to use a function to add/multiply this two numbers and call it from the main. I have done this so far. [CODE] int main() { int user_choice; int num1; …

Member Avatar for london-G
0
180
Member Avatar for Wheaties

Hello. I've got a homework assignment involving reading an unspecified number of numbers from a data file, storing it into a dynamically allocated array and doing various sorts and such(the output is basically a list of grades on some test that I do stuff like sort, average, give an accurate …

Member Avatar for jonsca
0
170
Member Avatar for abhimanipal

Hello Everybody, I have a small confusion with regards to pointers. Here is some code [CODE] int main() { int *p1 = (int*)malloc(sizeof(int)); *p1 = 10; printf("The number is %d",*(char*)p1); }[/CODE] I run the code and the O/p is 10. My question is, is there no difference in using char …

Member Avatar for nezachem
0
136
Member Avatar for gaurav_13191

I am trying to find out inorder successor of a node in a binary search tree. I read the algorithm from "Introduction to Algorithms,Cormen" and understood it. But the problem I face is that I can't find out the parent of the node when it is needed in the algorithm. …

Member Avatar for thekashyap
0
424
Member Avatar for manofhouse

ok so for some reason its telling me my "else" has no matching "if" in line 51, i have to make it so the binary output is spaced which im pretty sure i did and has to have a separate output if the character length is more than 8 [CODE]#include<iostream> …

Member Avatar for WaltP
0
462
Member Avatar for lissi

hi i'm using Dev c++ to compile my c code and i am facing this error.....i 'm new to this programming stuff....help me out Compiler: Default compiler Building Makefile: "C:\Dev-Cpp\project\Makefile.win" Executing make... make.exe -f "C:\Dev-Cpp\project\Makefile.win" all gcc.exe -c input.txt -o input.o -I"C:/Dev-Cpp/include" gcc.exe: input.txt: linker input file unused because linking …

Member Avatar for Ancient Dragon
0
98
Member Avatar for cyberbemon

i'm writing a C program in unix that take a number upto 5 and creates that amount of threads..if the use doesn't enter anything the program quits after 5 secs...and this is where i'm stuck T_T ..how do i do this ? time.h ? code of wat i've done so …

Member Avatar for Ancient Dragon
0
174
Member Avatar for BlueDevil

Hello everyone,I'm having a problem with an exercise in C,I hope more experienced programmers will help me.I want to create a simple version of the game Tic-Tac-Toe.In my edition there will be a 3x3 matrix.The 2 players that will play the game will start to fill the matrix with the …

Member Avatar for abhimanipal
0
94
Member Avatar for uditjindal

I want to update information i previously stored on a file but cannt do. My code is[CODE]//----------------------------- //--------------------------------"s"-Structure created-------------------- struct student { char regno[20]; //----------------------Pinfo var------------------ char name[50],gender[7],dob[20],otno[20],colg[50],branch[20],hno[10]; int rno; //----------------------Einfo var------------------ char doj[10]; float teage,twage; //----------------------Painfo var----------------- char fname[20],occ[50],ladd[100],cadd[100],ftno[20]; //----------------------Payinfo var---------------- char payj[200],dues[200],smoney[200],mode[20]; //----------------------Remarks var---------------- char remark[900]; //----------------------Marks var------------------ …

Member Avatar for abhimanipal
0
142
Member Avatar for rockerjhr

[CODE]i need a function that checks in two linked lists are equal thi is what i have so far bool equal(list L1 , list L2 , int (*p_cmp_f)() ){ if( L1==NULL && L2==NULL) return TRUE; else if( L1==NULL || L2==NULL) return FALSE; else if( (*p_cmp_f)(L1->data,L2->data) == -1) return FALSE; else …

Member Avatar for rockerjhr
0
207
Member Avatar for rockerjhr

[CODE]#include <stdio.h> #include <stdlib.h> #include "globals.h" #include "list.h" status write_int(generic_ptr p_n)){ printf(" %d " , *(int *)p_n ) ; return OK ; } int compare_int( generic_ptr x , generic_ptr y){ if( *(int*) x < *(int *)y ) return -1 ; if( *(int*) x > *(int *)y ) return 1 ; …

Member Avatar for rubberman
0
199
Member Avatar for maxxjr

(I did search for this, but didn't find exactly what I am looking for). I am working on a function that will generate a sine wave at a given frequency AND sampling rate. Something that will "fill a 10k sample buffer with a 1 kHz wave at a 44.1 kHz …

Member Avatar for gusano79
0
8K
Member Avatar for nadleeh

how would i go about sorting multiple items in a binary search tree.. for example if i have a list of first last and middle names and i want to sort it in a tree by last name, how would i store all three of them in each node.. should …

Member Avatar for Narue
0
117
Member Avatar for manofhouse

Need help converting from hex to binary any help is very appreciated!! [CODE]#include <string> #include <iostream> class Hex { private: //constructor std::string hexNumber; int decNumber; public: Hex(std::string hNum): hexNumber(hNum) {} Hex(int dNum): decNumber(dNum) {} ~Hex(); int toInt(); std::string toBin(); std::string toHex(); }; [/CODE] it keeps saying i need to put …

Member Avatar for VernonDozier
0
413
Member Avatar for meet123321

Hi folks , i am working on hastable nowdays and looking ways to optimize my code . Please comment on my below observations and let me know if you have any suggestions. I have an existing implementation of chained hash table (A), which uses singly link list for chaining. typedef …

Member Avatar for Narue
0
192
Member Avatar for aditi17
Member Avatar for prvnkmr194
-1
67
Member Avatar for ImDead

I have so much trouble in making this thing work. This is what i supposed to do: 1.build program to make histogram 2.The program should also calculate average and median. 3.The array should come from the text file. The problem is..i can build the histogram..but i have problem to get …

Member Avatar for abhimanipal
0
158
Member Avatar for charchar88

I usually program in java but I'm going to implement this in C but the general logic psuedo code should work I would think. these numbers represent these characters: 2-abc 3-def 4-ghi 5-jkl 6-mno 7pqrs 8-tuv 9-wxyz If I were to type in a 7 digit number say 233-7687 as …

Member Avatar for abhimanipal
0
206

The End.