15,551 Topics
| |
[B]For inserting a node at the beginning y the foll code wont work?[/B] [code] struct node { int data; struct node *-next; }*head,*run,*ptr; typedef struct node n; void create() { if(head==NULL) { head=n*(malloc(sizeof(n)); } else { ptr=n*(malloc(sizeof(n)); ptr=head; scanf("%d",&ptr->data); head=ptr->data; ptr=ptr->next; } [/code] | |
Hello All, I have a different question from my previous post. The problem I have now is that I want to output multiple files, having the names output1, output2, output3,....etc. I have a loop in which I do some things that output to the output file, but what I can't … | |
Hello All, I wonder if there is a way that I can generate a random data vector from a uniform discrete distribution, a normal distribution, an exponential distribution,.....etc? Thanks for your help in advance! Aly | |
Hi, there !... I just found some reference here ([url]http://www.daniweb.com/forums/thread160974.html[/url]) how to used malloc on multidimentional array. I tried it to apply on my case using Microsoft Visual C++. Basically my code is to read an array of numbers in txt file. The rows and cols of array dimension are … | |
Okay so I have a problem that involves assigning random masses to cars and assigning these into random positions (on a "grid" if you would like to picture it that way) which will eventually move around and cars with a bigger mass will destroy the smaller ones and then I … | |
i'm writing a program that takes a string and list of files and prints all the lines that contain the string. i'm having problems with my findString method. i did some debugging and it turns out when i call strcmp on strings that are the same it returns -1 or … | |
I would liek to invisibly run a console application, capture it's output, and save its contents into a log window with an edit control. I know it's possible becuase i've seen it done, but how can I capture terminal output? | |
hai I am new to socket programming.Its greek and latin to me.can someone tel me wat actually happens with socket programming.Or can u plz suggest some good links for socket programming tutorials | |
Hi all, In my application i will be writing data to a text file periodically (assume every 5 min.) after some time i want clear the old contents without halting the application and with out deleting the file. thanks in advance johny | |
ok so im creating a program minmax to find the minimum and maximum numbers of an array. heres my code but i get segmentation fault where do you think im going wrong? [code=C] #include <stdio.h> #include <stdlib.h> void minmax( int numberlist[], int n, int *p_min, int *p_max ); int main( … | |
When i tried to make the structure members(res_name,res_loc) as char pointer, i am getting error. i don't know how to convert res_name[25] to pointer.plz help me in this [icode] #include<stdio.h> #include<stdlib.h> #include<string.h> #define MAX 10 struct resource { int res_type; char res_name[25]; // i want to use this as char … | |
I have a set of attributes such as group id,group name,etc related to a linux process. I want to know how to start a process in linux using C program.Plz do help me. | |
Hi guys, I am new to programming a Rabbit microprocessor 4000. Are there any emulator or simulator program that allows my codings to be tested WITHOUT uploading the codes into the processor and then telnet in to test its response? For now, I am doing something like Command Line Interpreter... … | |
hi all, could you please suggest some good websites where I can find tutorials on embedded programming? Thankyou. | |
Hi, can you please tell me how to calculate execution time from the listing file shown below [CODE] 1 ; C Compiler for M68HC08 (COSMIC Software) 2 ; Generator V4.5.10.1 - 14 Jun 2007 3 ; Optimizer V4.5.4.2 - 17 Jul 2007 5 xref _printf 32 ; 1 void main(void) … | |
I recently learned a little bit about sorting algorithm efficiency. I looked at the merge sort and saw how it could be implemented using a scratch array to store the result until it was finished. It then talked about in place algorithms but didn't offer one for a merge sort, … | |
Hi. I'm newbie in C language (and in programming in general) and I don't know if this is possible. Imagine you have an integer variable called "number" with a number, and when you executes a function, this function creates a variable called "audio1" and increments number (number ++; ). The … | |
Hi..... I am Prida Thabah doing my MS in Medical Software of Manipal, presently i am in Final year doing my project. My project is about (ROI-region of interest based Lossless Medical Image Compression Algorithm with JPEG 2000), hereby i have attached my mini Report. According to the flow of … | |
i'm asking for homework help. i've come to my wits end trying to figure this out and it's due midnight tommorrow est. i'm supposed to write a program to read an inventory file and create the inventory report ( i did that with the given data minus the 5 column … | |
Heya im having a little trouble getting parts of the project to compile; [code=syntax] fscanf(fi, %f, &Max); [/code] this is continualy displaying the error message "syntax error before '%' token " i am compiling on Dev- C its probably simple but help is much appreciated thanks here is the program … | |
i have this kinda game, which inputs an integer.. but my problem is, when the user inputs a char variable, the program stops. it should say that the user entered an invalid box number. but it stops scanning when the user enters a char variable. help me pls... here is … | |
hiii, i have to prepare a presentation on switch giving any code example i need a little help to select what program should i make to present???? plzzzz reply quick...... | |
in my problem i have to enter the components of matrix in 2D array i.e input: 1 5 6 3 9 10 8 23 15 output: 1 3 5 6 8 9 0 15 23 | |
Please help me to solv this program known circular matrix input=3 output like 1 2 3 8 9 4 7 6 5 | |
Hello, I have been given an assignment in which I am to write an assembly language version of the following binary search function & use a suitable main program written in C to test my function. The function in C in which I had to translate to assembly is: [CODE]int … | |
Hello, i need to use fork() for the below problem Problem statement is program would accept various 2d arrays as inputs as long as the user wishes to enter.. Every individual sum of the array is calculated and sum of each array becomes the element of a resultant array and … | |
We know #define statements are executed before the program is compiled (preprocessor directives) and so the characters used should have no other meaning (say keywords),but still the following statement is not possible and is erroneous why ? [code=c]#define int float[/code] How many passes would the preprocessor directives run for as … | |
I wrote a function in file example1.c as below: [ICODE] void function(int a) { char buffer1[1]; } [/ICODE] When used "gcc -S -o example1.s example1.c, I got the following assembly code: [ICODE] _function: pushl %ebp movl %esp, %ebp subl $4, %esp leave ret [/ICODE] And if I change buffer1[1] to … | |
ok this code gets three sides of a triangle and prints out the area... but it just prints out that the area is 0 every time... why? [code=C] #include <stdio.h> #include <math.h> double area(int a, int b, int c); int main(int argc, char *argv[]){ int a, b, c; printf("\nSide A: … | |
i have made the following code... but i am having problems in accessing it.. [code] //structure for queue struct queue{ int items[MAX]; int front; int rear; }; //decleration of the queues :que_term for the values printed on the terminal struct queue que_mul2,que_mul3,que_mul5,que_sort,que_write,que_term; //initializing the queue void InitQueue(queue &q) { q.front=0; … |
The End.