15,540 Topics

Member Avatar for
Member Avatar for coconauts

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]

Member Avatar for Salem
0
105
Member Avatar for rickymak

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 …

Member Avatar for UncleLeroy
0
124
Member Avatar for jgehlot09

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 …

Member Avatar for jephthah
0
204
Member Avatar for riahc3

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 …

Member Avatar for jephthah
0
184
Member Avatar for bongoboia

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 …

Member Avatar for nezachem
0
157
Member Avatar for veeresh.k

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...

Member Avatar for Salem
0
116
Member Avatar for praddy85

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 …

Member Avatar for Narue
0
83
Member Avatar for Signal_Hill

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 …

Member Avatar for Adak
0
90
Member Avatar for tquiva

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 …

Member Avatar for jephthah
1
280
Member Avatar for fattymuffin

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 …

Member Avatar for tcstom
0
99
Member Avatar for deeep

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 …

Member Avatar for jephthah
0
166
Member Avatar for rlhh

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) …

Member Avatar for jephthah
0
188
Member Avatar for seaman34

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 …

Member Avatar for p.y.
0
153
Member Avatar for mrblippy

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 …

Member Avatar for Ancient Dragon
0
113
Member Avatar for lotrgandalf

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 …

Member Avatar for lotrgandalf
0
106
Member Avatar for schwarznavy

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 …

Member Avatar for schwarznavy
0
143
Member Avatar for r5berndt

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 …

Member Avatar for Fbody
0
100
Member Avatar for rajesh.c

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 …

Member Avatar for Fbody
0
106
Member Avatar for xx_infer

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??

Member Avatar for Salem
0
102
Member Avatar for GyanPP

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 …

Member Avatar for Nick Evan
0
58
Member Avatar for lotrgandalf

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 …

Member Avatar for gerard4143
0
97
Member Avatar for COKEDUDE

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?

Member Avatar for Banfa
0
213
Member Avatar for BestJewSinceJC

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 …

0
77
Member Avatar for R3Slick

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 …

Member Avatar for R3Slick
0
192
Member Avatar for sgriffin

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 …

Member Avatar for sgriffin
0
268
Member Avatar for urbangeek

[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

Member Avatar for urbangeek
0
87
Member Avatar for phin

I need help with writing a code that can count the number of functions and member functions per class! Please!

Member Avatar for Salem
0
94
Member Avatar for jeffhorton1965

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 …

Member Avatar for jeffhorton1965
0
198
Member Avatar for rontab68

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]; } . . .

Member Avatar for kvprajapati
0
106
Member Avatar for tquiva

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 …

Member Avatar for tquiva
1
219

The End.