15,552 Topics
| |
Hello all, long time since i've posted anything here. Working on a small project and nearing the end; however i am having some trouble regarding pointers to 'multidimensional' arrays, hopefully somebody can help me out. :) I have what i think is an array of 2D arrays of which I … | |
Hi! My problems are more of porting a code to Windows, than the code itself. I need to download a file from a URL ( http://127.0.0.1/img.jpg ) and store it in a local file. I think I've screwed up the setting up of the libcurl libraries. I am using Visual … | |
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 … | |
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 | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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; … | |
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 = … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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? … | |
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 … | |
| 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 … |
[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 … | |
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 … | |
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 … | |
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... | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … |
The End.