15,551 Topics
| |
We were supposed too make a program that would connect the given 2 points of a line. My program has a problem if the slope of the line is not 1. I'm just a noob in programing and still don't know how to clear the screen using system(); [code] #include<stdio.h> … | |
Can any one tell m what r th use of reentrant function and how to use it. | |
hope all r doing fine.. i need a quick and very quick reply m porting some cod:confused: e from windows to linux box..n i just encountered a function findfirstfile() used in windows..this function also takes wildcards as regular expression in the string I searched the net for an alternate implementation … | |
enter 5 digit number s and have them display in single digits,using division and the remainder mod. This is what i have so far but it doesnt seem to work. #include <stdio.h> int main() { int num1,num2,num3,num4,num5,number; printf("enter five digit number"); scanf("%d,%d,%d,%d,%d",&num1,&num2,&num3,&num4,&num5); num1r=(number-(number%10000))/10000; num2=(number%10000-(number%1000))/1000; num3=(number%1000-(number%100))/100; num4=(number%100-(number%10))/10; num5=(number%10-(number%1))/1; printf("first number is … | |
Hey guys, in c i am trying to read an input such as a command like [code] xeyes -bg red -fg blue [/code] i have managed to read it fine if there is no spaces so a single word such as "abc" but when i have spaces i get segmentation … | |
Hello! im new here and i have a problem regarding programming. We are required to compute for the distance of a certain city to another city...for example whats the distance of new york to los angeles..then the program will compute its distance... the output of the said program should be … | |
Hi, I wrote a function in 'C' as follows. [CODE]void myfunc(int x,int y) { asm mov ah , 0x02 asm mov bh , 0x0 asm mov dh , y <=Error Here asm mov dl , x <=Error Here } [/CODE] It shows the error "Invalid use of Opcode and Operand". … | |
Hi. Below are two pieces of code. This first one works fine: [code] char str[] = "Hello World"; char *b; b = &(str[3]); *b = '3'; printf("%s\n", str); [/code] However this second one results in a segmentation fault. [code] char *str = "Hello World"; char *b; b = &(str[3]); *b … | |
Hi friends, I have one question, if anybody can answer it. Question : (I am performing operations on tape drive using st driver) While performing read operation on tape (using read()), EOD occured. After EOD occured, i m firing MTIOCGET request and getting the tape status. After getting tape status, … | |
hi all, i have a problem with pthread programming. function_1(){ . . rc = pthread_create(&thread, &attr, my_function, (void *)&my_data); . rc = pthread_create(&thread, &attr, my_function, (void *)&my_data); . } As the above “`function_1`” do, the “`my_function`” can be executed any number of time according to our need, but the problem … | |
Dear Friends, I am developing a small project in which the users have to fill a form from which it will be saved into a database. Here i wanted to scan a particular folder in the hard-drive contineously so as to know if there is any new file saved in … | |
Hi, I want to make some kind of monitor for my PC and i want to have CPU load in form like "top" (something% , ex 23%). So i use C and : i'm opening the file /proc/stat and read the first line : cpu 92208 2282668 19432 79824 739 … | |
Hello,I am doing a project in which i need to send and receive data from a microcontroller.I was trying to do this in DEV CPP IDE 4.9.9.2 but couldn't succeed till now.The following is the code i tried compiling. The code: [code] #include <bios.h> #include <conio.h> #define COM1 0 #define … | |
Hi. I've written a small static (Unix .a) library, as usual made from a bunch of .c and .h files. A lot of the functions in the .h files are internal to the final library. Only a few of the .h files containing the public interface. How can I hide … | |
Hi, I am trying to create a method that accepts a pointer to a (static) string so that it can modify the string. I have something similar to this: [code] void modifyString(char **pstr) { char *str = *pstr; // Make changes to str ... } void doSomething() { char str[] … | |
Hi. Do you know how to get and set cursor position in C language? I know this can be done using GetCursorPos and SetCursorPos from Win32 Api but I want it to work on several OS so I cant use Win32 specific functions. Thanks. | |
if this topic is already up pleas point me to it coz i dont even know how to search it.... what i want to do is a small screen in the big screen and have all my printf(""); to print there... i dont know what else to say so pleas … | |
Hello folks, Does anyone know of any links that contain sample code for an FTP server implemented in C. | |
Hi everybody. First, sorry for my english, i am argentinian. I am trying to use a c library called openDBX that helps us talk to different RDBMS. Here is the link: [url]http://www.linuxnetworks.de/doc/index.php/OpenDBX[/url] I have already compiled and installed. Now, i am trying a simple c programe that uses it. The … | |
I need to write a code for reading values from the serial port and dumping them onto a text file, can someone help me? Whats required is that the changing values in the serial port has to to be updated frequently onto a text file. thanks for any help | |
Hi guys! I'm trying to rid my words of newline characters (and eventually punctuation as well). The words are in a two-dimensional array declared as words[MAXWORD][MAXLINE], where MAXWORD is currently 8000, and MAXLINE is currently 20. So up to 8000 words of 20 characters each. To do this, I am … | |
The following snippet finds the least, greatest and sum of the elements of an array. It works when I give the test condition with variable "i" in the for loop (as in the first snippet). But when I replace it with a pointer(as in second snippet), it gives a wrong … | |
[code=cpp]struct Product{ /* declare variables here to store product data */ char product_name[LEN]; int product_id; int quantity; double unit_price; int expire_month, expire_year; struct Product *next; }; pfile=fopen("binary.bin","wb"); if(pfile!=NULL) { while(head != NULL) { fwrite(&head, sizeof(struct Product), 1, pfile); //head=head->next; } fclose(pfile); puts("File Saved successfully!"); system("pause"); } else { puts("File not … | |
Hello, I am running a lightly random-based heuristic search with a problem, and I encounter something quite peculiar. When I run the program using no compiler optimization, I obtain results that are consistently worse than when I use compiler optimization (-O3 parameter using gcc). What I mean by "results" is … | |
please could any one give me hints in this question A popular method of displaying data is a Histogram. A histogram counts how many items of data fall in each of n equally sized intervals and displays the results as a bar chart in which each bar is proportional in … | |
Hi, again. I'm trying to read in data from a file that I've opened, so it is sitting in FILE* fp. Now I want to put it into a format that I can do things with it (seperate it into words). My question is: how can I do this dynamically? … | |
Hey everyone, I'm attempting to write a program that will pipe and fork to have a parent and child process. Then the parent writes numbers to the pipe and the child either multiplies or divides the two numbers. For some reason my file I/O isn't working. It's supposed to keep … | |
In PHP I can use the pack function to format a integer value to a 16 bit wav channel chunk. It gets the endianness right and it works. How would one go about creating raw wav data in c? [code] function cram ($integer, $type = 's', $length = '*') { … | |
i have no idea whats wrong with this function =\ [code] void throw_cards(card h_cards[]) { char f; cleardevice(); while(f!='f') { printf("from 0 to 6 pick the cards you want to thorw\n"); printf("to finish hit 'f'"); f=getch(); printf("trowing card %c",f); } } [/code] i get the error: Type mismatch in redecleration … | |
Hi folks. I'm trying to do something I hope is very simple -- taking an argument placed after the program's name and storing it. So, if I type whatnumber 4 it will store the value 4, whatnumber 100 will store 100, etc. I've tried using int argc, char *argv[] instead … |
The End.