15,550 Topics

Member Avatar for
Member Avatar for katwalatapan

Hello, I have observed a data access misaligned error in my code. I am trying to isolate the issue and find reason for its occurrence. [code=c] float *mul; int main(void) { int i; mul=(float *)malloc(36000); *mul=0; for(i=1; i<9000; i++) { *(mul+i)=*(mul+(i-1))+(1/(float)(72000/2)); printf("%f\t", *(mul+i)); } free(mul); return 0; } [/code] Please …

Member Avatar for katwalatapan
0
336
Member Avatar for jindalboss

can u please tell me books ,links to learn c graphics i am very desperate to learn but not getting something i start from right now i have only graphics under c yashwant kanetkar plz help me out

Member Avatar for Ancient Dragon
0
25
Member Avatar for Aurorian

Hello Daniweb, I'm new to C and I need help with this basic calculator. It's supposed to calculate investment, only it never gives me the correct result Here is the source, [code] #include <stdio.h> #include <stdlib.h> #include <windows.h> #include <math.h> int main() { double result; int a; int b; int …

Member Avatar for Aurorian
0
197
Member Avatar for jose385

Hello, I've been working with C trying to get factorials which I've successfully accomplished but my code needs to output an error message when inputting negative numbers, unfortunately my code outputs an error when using 1 and 0. This is what my code looks like (keep in mind I'm a …

Member Avatar for jose385
0
109
Member Avatar for Iam3R

Hi , when i run the program i got the same out put by using memcpy and memmove but i dont understand the difference between them. manual page says that memory area should not overlap in memcpy but can in memmove. what is meant by moving memory and how its …

Member Avatar for Salem
0
690
Member Avatar for aliase

Hi, I'm having a problem with signal handling between parent and child. What I'm trying to do is for both parent and child to be able to receive ctrl-z, however when the child receives ctrl-z, parent receives it as well and I don't want parent to do that. Any idea …

Member Avatar for Salem
0
38
Member Avatar for donelliewhyte

Smiles dental centre requires a computer system that can maintain records on its patients as well as automate specific processes that take place daily. The centre has a dental surgeon, an orthodontist and a dentist. The orthodontist deals with customers with braces (new and existing customers); the dental surgeon will …

Member Avatar for Ancient Dragon
0
140
Member Avatar for Aurorian

Hello Daniweb! I'm a beginner and C, and trying to make a program that asks a question in the main and takes an input from the user which jumps to the appropriate function. Here is the source. [code] #include <stdio.h> #include <stdlib.h> #include <math.h> void cm(){ float a; double b; …

Member Avatar for Murtan
0
96
Member Avatar for kendaop

Hello, I'm getting a segmentation fault in my code, at the IF statement. Can anyone tell me why? The printf() statement right before outputs the correct data, so *buffer definitely isn't null. Thanks for your help. [CODE]int main(int argc, char *argv[]) { FILE *inputFile, *rejects; char hold[200], hold2[30], *buffer = …

Member Avatar for abhimanipal
0
122
Member Avatar for Don_k

Hi guys here is what I aim to do : Create a program which 1. reads in a string of less than 25 characters from the user 2. prints out the string followed by its reverse i.e. if the user enters "hello", the program should print "helloolleh". I can do …

Member Avatar for abhimanipal
0
124
Member Avatar for Don_k

My aim is to create a program that: 1. reads in a string of less than 255 characters from the user into a variable called array1 2. copies array1 into a variable called array2, converting each element of array1 to UPPER CASE 3. prints out the contents of array2 I …

Member Avatar for Dave Sinkula
0
120
Member Avatar for freakzilla

Hi guys, I have been trying to implement a shared circular queue between 2 processes. My structures are as follows: [code] typedef struct client_entry { long shmid; int pid; struct client_entry *next; struct client_entry *prev; } client_entry_t; typedef struct client_queue { unsigned int num_entries; long current_shmid; int notify; struct client_entry …

Member Avatar for Salem
0
168
Member Avatar for EvilNerd

My problem is when i try to include the function [B]funcString[/B] in my code and try to built it , i get this errors: [QUOTE]error C2065: 'ch' : undeclared identifier[/QUOTE] And when i remove the function [B]funcString[/B] i don't get any error and the programs runs perfectly. HERE is my …

Member Avatar for EvilNerd
0
158
Member Avatar for Tango2010

Hi, I have been experiment with Recursion / Trasversal through directories recently but seem to have run into a few unexplainable errors. Attached is my source code which is a function (which has the path (input user directory) passed into it). What im hoping this function will do is detect …

Member Avatar for Salem
0
631
Member Avatar for drewangel

hello, i want to pass an array and 2 more integer elements in the routine of thread in pthread in c. i know i need to use structure for the same. i am using pointer to that structure in this case. i need to know--- what will happen if i …

Member Avatar for Salem
0
113
Member Avatar for logicalguy

Hi, I have a qsort problem I just can't solve. I've got an array of pointers to a structure called struct mys. The structure has an int value called id. I want to use qsort to sort this array of pointers to structure in ascending order by the id value …

Member Avatar for Dave Sinkula
0
5K
Member Avatar for akito1111

I tried to compile this code but it keeps telling me error C2446: '>' : no conversion from 'double' to 'float *' and error C2440: '>' : cannot convert from 'double' to 'float [5]' But I already converted it to float. Is there anyone can help to figure this out? …

Member Avatar for Aia
0
376
Member Avatar for iNach

I just tested because i'll need soon the fopen function... Im using Visual C++ and i made a txt file in the root (didn't work so also tried to put in the source folder.. didn't work either) the text file's name is: Keywords.txt I tried this: [CODE]fopen("Keywords", "r");[/CODE] didn't work …

Member Avatar for Salem
0
131
Member Avatar for manutm

Hi everybody, I'm looking for a way of getting a machine-specific string on windows, something like cpu or hard drive or bios serial #. It has to be implemented in c, not c++. I've already browsed the api quite a lot but I'm not sure (and I don't know windows …

Member Avatar for manutm
0
96
Member Avatar for shubhabrata

[I]<<thread split>>[/I] [CODE]#include <stdio.h> struct a { char aa; char ab; char ac; }; struct b { char b_a; char b_b; char b_c; char b_d; char b_e; char b_data[1]; }; int main() { struct b data_s; struct a *req; req =(struct a* )data_s.b_data; req->aa=3; req->ab=3; req->ac=25; printf("%x\n",data_s.b_data[0]); printf("%x\n",data_s.b_data[1]); printf("0x%x\n",data_s.b_data[2]); return …

Member Avatar for Adak
-1
151
Member Avatar for aliase

Hi, I'm having a problem creating two child and manipulating signals. My problem with forking is that when I do: [code=c] int main() { pid = fork(); pid2 = fork(); } [/code] This create more than two forks, so how do i create exactly two forks? And for each child …

Member Avatar for abhimanipal
0
74
Member Avatar for lionaneesh

i m a newbie in The pool of C plz tell me about these functions from absoulute basic.. I was studing C tutor and found these functions but cannot understand them.. plz tell me their exact functions breifly.. or u can also suggest me some ebooks.. free only.. Thnx in …

Member Avatar for lionaneesh
0
191
Member Avatar for japheth 2010

people can you help me how to make a c language that has, add, edit, save, view, and link list delete? i do really need it for my project... please help me...

Member Avatar for Adak
-2
85
Member Avatar for vijayr_singh

Hi friends... I need to write a program in C which will print all the combinations of a string with non-repeating characters. Example: “Say” will have the following: S, a,y, Sa, Sy, aS,Sy, yS, ya, aSy,Sya,ySa and so on. The string length is not known. The string will be a …

Member Avatar for siriussam
-1
895
Member Avatar for johndoe444

this is the problem area: [CODE]FILE* fp = fopen(file_name, "r"); if (fp == NULL) printf("couldn't open file\n"); char line[100]; while ((fscanf(fp, " %[^\n]", line) != EOF)) { printf("%s\n",line); clock_t start = clock(); perform_operation(line, 1); clock_t end = clock(); sprintf(log_msg, "time taken: %ld ms",(end-start)); log(log_msg); } sprintf(log_msg, "final tree"); if (fp …

Member Avatar for Adak
0
182
Member Avatar for phil750

I have a program, my own shell where the first input is command and the 2nd is cmd. Im trying to get cd working but having trouble with chdir function, i have this and it just gives me a segmentation fault and i dont understand why. [code] while(!strcmp(command,"cd")) // while …

Member Avatar for phil750
0
532
Member Avatar for nhalavanja

Hello all I am currently coding a starter multi threading program in c. It is supposed to find all the prime numbers from 2 to n. I have no previous experience in thread coding so I am looking for some help and maybe some debugging advise It only calculates primes …

Member Avatar for Salem
0
1K
Member Avatar for hamilton168

I am tring to get this program together and can't seem to make it work. Ok. . this program is to take in a file with a matrix of zeros and numbers 1-9. The zeros are shaded and the numbers are part of a block. All numbers and the ones …

Member Avatar for Adak
0
145
Member Avatar for ddebevec

I have a client/server socket program example that I am modifying in order to pass a parameter to a called program on the server side. The problem that I’m encountering is trying to build a command line string that will execute the called program from a “system()” function. I’m testing …

0
40
Member Avatar for donelliewhyte

I am trying to try search a file for a record based on on a number is enter which is printed to a file under registratation number.I just want to know if my coding is correct.Below is a sample of the module. [CODE]{ struct custinfo info; FILE *customer; char number[5]; …

Member Avatar for WaltP
0
216

The End.