15,552 Topics
| |
Take the following C structure: typedef struct dataPoint { tick * tickData; struct dataPoint * previousDataPoint; struct dataPoint * nextDataPoint; } dataPoint; Compiling on a 64-bit system with 8-byte words, this structure takes up 24 bytes (3 words) of memory. 24 % 8 = 0 ... so it is word … | |
a linked list is given, and a only pointer to a node is given which need to be deleted. it is singly linked list. you dnt have accees to any other pointer like head or what. you only have that node pointer in ur hand. thanks. | |
i have thought a lot on this. but not getting O(n) solution. given n URL's and you have to find the unique URL in that (if there is any). you have to print that URL. thanks. O(n2) solution is a stupid solution, some O(n) is acheivable, but not getting how … | |
may any one suggest some sample code how to store the video file frame data into arrays by programming in C.... | |
int my_filewrite(char *question) { char filename[100]; int fd; printf(question); scanf("%s", filename); if (strlen(filename) > 100) } return 0; please can you help to find potential vulnerabilities in this code? Thank you. | |
Please Help me to get the solution of this pattersn as i am weak in loops that is why i am asking and i have my exam tommorrow . | |
Hello all, im quite new to network programming,im writing c code which dealt with transferring files using TCP over Sockets, In my code,client sends the header information(information about the file ) to the server ,the code works fine but received file size is sporadically a small than the file that … | |
i've written these codes to evaluate a total heat transfer.but there are some problem arrived #include<stdio.h> #include<conio.h> #include<stdlib.h> int main() { int *temp,*thick,*area,*cond,total_temp,n,i; double q,total_other; temp=(int *)malloc(20 * sizeof(int)); thick=(int *)malloc(20 * sizeof(int)); area=(int *)malloc(20 * sizeof(int)); cond=(int *)malloc(20 * sizeof(int)); printf("how many slabs?"); scanf("%d",&n); for(i=0;i<=n;i++){ scanf("%d",&temp[i]); } for(i=0;i<n;i++){ scanf(" … | |
int a[]={1,3,4,5,7}; int b[]={2,3,5,6}; int m=sizeof(a)/sizeof(int); int n=sizeof(b)/sizeof(int); cout<<m<<" "<<n<<endl; this code prints 5,4. but when i pass the arrays to some function and then i print the m,n values then it is printing 1,1. i know that they are acting as pointer when i pass then in function and … | |
Hi folks.. Here comes the same old question ..."How to get the source code for an exe file??" Firstly , i am bored of asking this question as i dont think it is possible.. But what made me to re-ask this question is the excitement of some file that i … | |
Hi, I am working on a program that uses an array of integers(1 and 0) to represent a gray code. For this to work I first have to take an integer and convert it to the binary, then convert the binary to gray code. The for loops i use to … | |
is it possible to allocate memory for multiple pointer using single malloc like this #include<stdio.h> #include<conio.h> #include<stdlib.h> int main() { int *p,*q,*r,*n; p,q,r,n=(int *)malloc(20 * sizeof(int)); | |
can anyone give me some good references or links or some guidelines to start with this ? i need to learn this. like i want to know how can i implement malloc, calloc, realloc etc. for this thing also, what do i need to learn firstly ? thanks. any kind … | |
I want to Print Characters ABCD.. in Pattern but this code is not printing output on screen , Please Guide me and Tell me where is my mistake ? #include<stdio.h> #include<conio.h> main() { int i,j; int count=65; for(i=0;i<=10;i++) { for(j=65;j<=i;j++;count++) { printf("%c",count); } printf("\n"); } } | |
this is my code, when even i run it it tells me that the number is even while it is odd. #include<stdio.h> #include<stdlib.h> int main(void) { int value; /* To read a number and say wheither it is even or odd*/ printf("Please enter any number \n"); scanf("%u", &value); if (value/2 … | |
How can I write a program to find the sum of the series given below:- ((1)/(2))+((3)/(4))+((5)/(6))+((7)/(8))+((9)/(10))......n I have written a code but it is not giving the desired result... #include<stdio.h> #include<conio.h> void main() { int n; float sum=0,i; printf("Enter nthe term"); scanf("%d",&n); for(i=0;i<n;i++) { sum=sum+((i+1)/(i+2)); } printf("sum=%f",sum); getch(); } Please … | |
hi, after a long time been posting in this forum.I am trying to manipulate newtons divide difference formula ,actually like this [see here](http://www.dailyfreecode.com/code/newtons-divided-difference-method-2381.aspx) but in a different manner .but my code is not working.i am getting disgusting values in my table.can any one please check the errors and tell me … | |
Any of you knows a way to solve Power cricis [Click Here](http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=87) So fare i've found this code but i doesnt help much as it takes N as input(13<N<100) and return an M so that the last one standing is the 13th city. int main() { int N, M; struct … | |
hi, after a long time been posting in this forum.I am trying to manipulate newtons divide difference formula ,actually like this [see it here](http://www.dailyfreecode.com/code/newtons-divided-difference-method-2381.aspx) **but in a different manner** .but my code is not working.i am getting disgusting values in my table.can any one please check the errors and tell … | |
hey guys I need help with this I have no idea how to work this out please help me with like atleast the starting coding i am trying to google too but i cannot find any info on this. ***"char * copyString( const char * s ); copyString returns a … | |
Hey guys! It's been a long time since I visited daniweb,but I need some help understanding something.A friend of mine gave me problem to solve, but the assignment is strange,I can't seem to find the actually meaning of what I need to generate as an answer.Here goes: By a given … | |
I am doing code for CAESAR CIPHER. I need to built a histogram or frequency distribution for the output. I thought that finding out the frequency of the ASCII code, then print the frequency with * by using loop. But my code din't have array, can't do ++freq[c[i]]. I have … | |
| Hello, i have create a human tree, the only remains is to get the codes in Huffman tree (0-Left, 1-Right) How i can traverse the tree and for every letter-weight in tree to get the path of 0101 How my code works ***1st Part - Nodes Initialisation*** - Create Tree … |
hello friends i wanna know is this algorithm for Travelling salesman problem (TSP) correct ? if isn't help me for correct algorithm plz ? tnx int tsp(int **adjMatrix, int numberPoints) { for (int i = 0; i < numberPoints; i++) for (int j = 0; j < numberPoints; j++) for … | |
Can someone point me towards a dead basic, complete example of a hash table utilising chaining? I've got a working hash function, I am just getting really frustrated with not understanding what I don't understand with the setting up of the hash table. All the examples on the web I've … | |
So I just started a "C" class and I've done my first few assignments but I feel like I'm over complicating the codes by using to many if else statements. Here's the assignment and my code. Please let me know what you think: [B]Write a program that asks the user … | |
| Hi, I am trying to write a program which read a certain input in a particular format and then gives an ouput. I wrote a code to read the file. Input is something like this. X 20 60 80 90 X 78 98 97 96 X 34 35 43 23 … |
FUNCTIONS the question is as follows: write a function, ComputeAmount, that takes as input the quantity of an item and the item unit price, and returns the net amount to be paid by customer. my program is working correctly please advise me what i did wrong here are the codes: … | |
i want to write a sever application.my sever have some service to client. some of the answer of my server is long(transfer file) and some of them is short(list of online client). when server transferring file to a client , other client request to get online client list. i want … | |
Hello everyone. I have to connect to a running server on another host [COMPLETED]. Then, I have to perform a webchat with any chosen single client in the server and I have some questions about that. I am able to connect to any chosen client in the server, I am … |
The End.