15,540 Topics
| |
I am a beginner trying to write a program for my intro C class. I am trying to write a program that calculates the combination of numbers given a specific output by the user. The number has to be between 1-10 to be valid. I am not allowed to use … | |
I am writing a c program to copy content of one text file to another but with the copied lines in the destination file preceded by the length of the line and a blank space. Let me illustrate my expectation: original.txt destination.txt daniweb 7 daniweb forum 5 forum plz help … | |
hello, is there any way to call a specific variable from a function ? see the following program. [CODE] float abc(void); float main(void) { float a,b,y,z; a=abc(); b= printf ("enter value for z"); scanf ("%f",&z); y=(a-(a*y))/(b*z); printf ("%f",y); } float abc(void) { float x,p; scanf ("%f",&x); p=x*x; return(p); }[/CODE] in … | |
Hello, I have been trying to setup mysql API with C. I followed tutorials but I don't think I am installing the API correctly. Could someone tell me the package to download, and what to do with it. Thank you very much. | |
I have a file name fun.c contain the fuction to add two number (addnum(a,b)).Now I create another file name callfunc.c.Here I want to call the function (addnum(a,b)) from the file fun.c. How can I do that?. | |
I've learned to write bytes from a file by reading the entire file into a character array and then writing them out to another file using fwrite. Of course, my teacher told me this is both wasteful and a file might not fit into memory, so I should use another … | |
I'm going crazy. I've been trying to a linked list of a struct (which stores some strings and a character) however I've had no luck. It's just not working and I've been working on this for hours on end. Note: StorePtr is a pointer to the Store struct (which stores … | |
I'm writing a program to read data and store it to file. However I am a bit confused by the EOF statement, and how to get my program to stop reading when there is no more data to read. My code looks like this [code]while((c=fgetc(fin2))!=EOF) { if(c=='#'){ while((c=fgetc(fin2))!='\n'){ }} else{ … | |
im writing this program for an intro to c class, I was wondering if anyone knows whats wrong with this code? it says theres an error with the first else, if i take the curly brackets out it says theres a problem with all 3 else's. Thanks. [CODE]#include <stdio.h> int … | |
There are many inbuilt functions for drawing lines in turbo c..is there any similar functions in ncursers library.....please tell me some equilvalent functions for setfillstyle() in the ncurses library. Thank u | |
hello friends can anyone please help me with a C version of a brute force cracker in which i can compare with a selected string and identify for a match.. the c version is in the link bellow [url]http://www.daniweb.com/forums/thread121991.html[/url] cheers | |
Are there any functions built in C to display the current time and date, and if there is could someone display its syntax Thanks..... | |
Hi, I am working on a small program that converts English to Morse code and back into English. The input is read from a file specified by the user no matter which way the conversion is going. I figured out the english to morse conversion pretty easily, by just reading … | |
Hey ppl, I'm doing a project which needs serial communication. I'm sending and receiving data from a PIC through the serial port. I'm using Windows XP and dev cpp. I'm succesfully sending data by my program to the PIC. I'm using inpout32.dll file to access serial port because windows dosen't … | |
how to go about tis program [CODE]int array[26] for(i=0;i<=25;i++) { array[i]=`A`+i; printf("\n %d %c "array[i],array[i][/CODE] | |
Hi, I am developing a client and server in C. Client encrypts some data and sends it to the server. The server receives the data and prints it out. I am using AES 128 bit encryption in CBC mode. But at the server side I am unable to receive any … | |
Hello Guys, I have found many source codes to implement linked list. But all are inserting or deleting the node values after user's choice. I dont want that. Insertion should happen dynamically. I have a client program running on another system. I fetch the data from that system through my … | |
hi can anyone tell me how to use the bgi library for windows in code blocks compiler...i have downloaded the libraries but dont know how to use it...please tell me the procedure | |
Hi im trying to allocate memory using malloc(). Also, im trying to make a copy of the string before i allocate it. So im using strcpy(). But im still having issues with compiling it. please help!! [CODE] #include <stdlib.h> #include "setup.h" char *run( const char * const str ){ strcpy(str) … | |
Hi all, This is a script that reads in text from a file and separates it into characters. It works fine as long as MAXSTRLEN is under 610000. However, I need it to read in whole books of text. Whenever I try to bump that number up above 610000 or … | |
Dear all, I am writting a code for high dimensional chebyshev interpolation. Since it is high dimensional, I MUST use extremely large arrays. Something like this: [CODE] #define DIM (int)2 #define TOTAL_STEPS (int)30 int main(){ double *a_data; long long a_dim; /** length of matrix a_data **/ int n; /** # … | |
I want to hold user input strings in an array and be able to print it. Is there a way for me to hold string 1 in arr[0], string 2 in arr[1] and so on and so forth? heres what Im thinking [CODE] int p=1, r=3, l=0; char arr[255]; while(p … | |
It is said in many places that comparing two floating numbers for equality can give wrong result and we have to take into account some epsilon value like this float f1,f2; if (f1-f2<epsilon) printf("gotcha"); So what is the reasonable estimate of epsilon? My intuition is that that has to be … | |
how does long and long long differ? The machine I am using has core 2 duo processor. It shows the same size (8 bytes) for both of them. Was short type ever was 1 byte and changed to 2 bytes later on? Was long and int ever was 4 byte … | |
hii i just downloaded a dev c++ compiler...& wrote the basic hello world program...whenever i try to compile ..my quickheal antivirus deletes it as a trojan...please help..i reinstalled it but gives the same result | |
I need an algorithm for the following problem: There's a tree with N fruits each with its own weight w[i] and height h[i]. I can only reach a fruit if it's no taller than H inches. Also every time I pick a fruit, all the other fruits in the tree … | |
hai friends can anyone give me an example of a program to hash using crypt(3) thanks linux learner. | |
Guys, I need help When I compile my code, I get [code]error: invalid operands to binary ^ (have ‘float’ and ‘double’)[/code] Here's some portion of my code: [code=c] #include <stdlib.h> #include <stdio.h> ... float freq; const float key_magic = 2 ^ (1/12); ... freq=440*(key_magic)^(atof(optarg)-49); [/code] Thanks | |
Can anyone tell me the valid priority values? positive or negative??I have two threads spawning from the main() , say thread1 and thread2. thread2 always executes much faster than thread1. I want the other way round, because thread1 is much more important than thread2 in my program. Hence I was … | |
I've got this game almost working. When I run it in my complier is "blows" up at this line: [CODE]if (facesInHand[numberInHand2][1] != 0 && facesInHand[numberInHand2][2] != 0 && facesInhand[numberInHand2][3] != 0 && facesInhand[numberInHand2][4] != 0 && facesInhand[numberInHand2][13] != 0) straight = 1; else straight = 0;[/CODE] and continues through the … |
The End.