15,552 Topics
| |
Hey, So I've got these instructions for a piece of work, but I don't understand what it's saying, there are prototypes for functions but like I said, I don't understand them. [CODE]typedef struct BigInteger* big_integer_t; // so I know typedef allows you to assign different names to existing types, but … | |
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 | |
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 … | |
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 … | |
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.. | |
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 … | |
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 … | |
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 < … | |
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 … | |
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. | |
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 … | |
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 … | |
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("") … | |
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; … | |
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 … | |
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 … | |
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. … | |
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> … | |
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 … | |
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 … | |
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 … | |
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------------------ … | |
[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 … | |
[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 ; … | |
(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 … | |
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 … | |
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 … | |
| 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 … |
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 … |
The End.