15,540 Topics
| |
how do i get the child id without calling wait? is there a way to put wait information back so another waitpid can get it...? [CODE] void sigchld_handler(int signo) { pid_t p = wait(NULL); ... } [/CODE] | |
I have this error, " lvalue required as left operand of assignment," for line 10 where scanf command appears. I can't figure out a solution to it. [CODE]#include <stdio.h> int main() { int start; char delay; printf("We're close to blast off.\n"); printf("countdown initiated"); scanf=("%d", &start); do { printf("T minus %d … | |
I am writing a simple code in c to extract the values from string for ex-P23V32 gives me output of 23*32. But when I am trying to use the isalpha() and isdigit() to check whether the value is a charecter or a digit, the compiler return always zero. Here is … | |
Hey Im doing a loop with somthing similar to this: [code=C] char stn[25]; do { printf ("Insert a number:\n"); gets(stn); }while (stn!="123"); if (str=="123") { printf ("Good value!"); } [/code] Now if I input 123, it enters the if that prints "Good value!" and the program ends naturally. Now if … | |
Hi to all, I have a problem and can't understand why this happen... I'll explain all now. I'm not a very good programmer, I'm just starting and I'm doing a program that must run on linux like a daemon. The job of this program is to take all the characters … | |
hi... 'm findin it difficult to access system date in a c program.. pls help me... N also to write code fo airline reservation in c... | |
Hi, Im a novice and im implementing a mp3 player. Im using the concept of doubley linked list for moving between songs in the directory... I have enclosed the code also.. the error i get is next_previous.c:80: warning: assignment makes integer from pointer without a cast next_previous.c:81: warning: initialization makes … | |
Hello All... To be honest, this is a bit overwhelming, but I'm hoping that someone might be able to steer me in the right direction. I am currently taking a correspondence course in Computer Programming, and without instructional support, am finding that the material can be somewhat overwhelming. I'm looking … | |
I need to create my own function to compute the cos of an angle (given in radians) using the Taylor series. The task is to create a function in which a float value is passed to it, and a double gets returned. My program compiled, but I am getting wrong … | |
Hello, So my problem is that I am supposed to write code in order to prove whether or not text in a file is topologically sorted correctly. I have the algorithm on how to do this, but the specifications say that I should use an array of lists to keep … | |
Hi we have a buffer say [COLOR="Red"]char array.[1].[/COLOR]so the size will be 1 byte. Now our problem is say we have 8 bits data say 10110101. now this must be assigned to array[0] variable as 1 byte. bit manipulation is not happening.kindly help us in this regard If possible post … | |
I'm trying to create a maze with a mouse inside moving up down left right in 200 moves. I've got everything working besides the fact that it duplicates the heart on the other side(If it exits on the left, it'll be duplicated at the right end) when the heart shape(mouse) … | |
Hello this is my first thread on the forum i tried to search everywhere for a solution but no result...:'( Im trying to figure out some easy pointer use but still get some stupid error... My fault. error C2440: '=' : cannot convert from 'char (*)[100]' to 'char' [CODE] void … | |
hello everyone, i have been given a task in my class to create a student database. it has to be able to allow a user to enter a class code, class name and a linked list of students enrolled in the class. the struct we have been given to use … | |
I am getting unpredictable behaviour from malloc(). Here is the code fragment: [code=c] float **t; t=(float **)malloc(sizeof(float *)*A); perror("\nError status 1:"); for(i=0;i<600;i++) { t[i]=malloc(sizeof(float)*B); } perror("\nError Status 2:"); [/code] The objective here is to have a dynamic 2D float type array. For testing purposes though, I have hard coded the … | |
| Hi. I'm trying to call a function to convert a decimal integer into a binary number (stored as an array of integers). Before I knew that I couldn't return an array, this is how I thought to implement it. Can anyone help me understand the way I'm actually supposed to … |
Hey guys, Im new here so I hope this post is in the right spot. Im trying to get my code to callout to the other functions. When I debug the code, it only executes the Int Main section of my code. Can someone help me out and explain how … | |
i m using char pointers to take data from char arrays of 4096 bytes and storing them into a file. the problem is............ if the data consist of only one buffer than the two datas are same but if there are more than two buffers than the data is different … | |
hi, i have problems using exec(), I need to pass a set of numbers using exec to another program that is supposed to use them to calculate something,,, i dont know how to pass them any suggestions?? | |
Hello, 1) I am trying to run gprof on the following code snippet: [CODE]int fc() { while (1); return 1; } int main () { fc (); return 1; }[/CODE] 2) compile: gcc -pg tmp.c 3) Execute gprof -a a.out 4) Fails with the following error: gmon.out: No such file … | |
Is there a straight way to compare variables from 2 different C programs in Visual Studio? The only way of variable comparison I can come up with is writing them to the disk using file handling and then comparing them using a third program. Does Visual Studio allow variables to … | |
Can someone please explain why "#include <stdlib.h>" fixes "warning: implicit declaration of function". Also what does #include <stdlib.h> mean and when should you use it? | |
How can I create a semaphore using the above functions that will allow [I]any[/I] process access to the semaphore? I've been playing around with global variables for hours thinking I was doing it wrong, but now I believe I was misled. I think the problem is that the other processes … | |
Hello everyone, I'm having trouble with a code I need to write, I have never coded in C and I need to do this program in C. I have created my checksum code already and need to implement this: I need to send a complete ASCII file in 128 byte … | |
Hey everyone, I am a brand new member and thought I could learn and get some help at the same time. I have an assignment that implements SECDED on a 16 bit word, storing the 5 checked bits and 1 parity bit in the upper 6 bits (makes a 22-bit … | |
[CODE]#include<stdio.h> #define sqrt(x) x*x int main(){ int x=5; int y=sqrt(x+1); printf("%d\n",y); return 0; } [/CODE] The answer is 11. Can anyone explain why? thanks | |
I need help with writing a code that can count the number of functions and member functions per class! Please! | |
In the following code I am calling a function from a pthread: [CODE]pthread_create(&threads[t], NULL, dnssearch, (void *)buffer)[/CODE] I need to pass the string (buffer) to a function and the have the function pass a string back. What am I doing wrong in the function: [CODE]void *dnssearch (void *buf) { char … | |
Hi, If I want to pass values of one array to another array, is this the proper code implementation. any alternative or suggestions Thanks. . . . for ( i=0; i<9; i++) for (j =0; j<9; j++){ receive[i][j]=transmit[i][j]; } . . . | |
Can someone please help me with this program? My goal is to create a test driver for the function put_result(). The program compiles and works as intended. However, I came across a bug that I am having an extremely difficult time trying to fix. I tested for several inputs and … |
The End.