15,552 Topics

Member Avatar for
Member Avatar for zeiken

I would like to ask about the strcpy or string how to use when the inputs:i like to play baseball then the output: i like to play baseball I hope there is recommendable code for that programs

Member Avatar for Narue
0
85
Member Avatar for antlu

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

Member Avatar for antlu
0
89
Member Avatar for Zafar Iqbal

Can any one tell m what r th use of reentrant function and how to use it.

Member Avatar for Narue
0
30
Member Avatar for nabilchampion

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 …

Member Avatar for nabilchampion
0
687
Member Avatar for wollacott

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 …

Member Avatar for WaltP
0
96
Member Avatar for nnobakht

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 …

Member Avatar for nnobakht
0
89
Member Avatar for jmvr_danga_14

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 …

Member Avatar for WolfPack
0
90
Member Avatar for osasm

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

Member Avatar for Duoas
0
283
Member Avatar for Dark_Knight

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 …

Member Avatar for WolfPack
0
288
Member Avatar for harish_s

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

Member Avatar for Salem
0
77
Member Avatar for rpjanaka

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 …

Member Avatar for Belrog
0
102
Member Avatar for riturajraina

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 …

Member Avatar for Narue
0
182
Member Avatar for Vagelis44

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 …

Member Avatar for Belrog
0
135
Member Avatar for danibootstrap

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 …

Member Avatar for danibootstrap
0
3K
Member Avatar for lastcraft

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 …

Member Avatar for lastcraft
0
164
Member Avatar for Dark_Knight

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[] …

Member Avatar for Dark_Knight
0
133
Member Avatar for Spartan552

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.

Member Avatar for Salem
0
188
Member Avatar for dv1r

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 …

Member Avatar for dv1r
0
384
Member Avatar for Bhandy

Hello folks, Does anyone know of any links that contain sample code for an FTP server implemented in C.

Member Avatar for Salem
0
39
Member Avatar for crapodino

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 …

Member Avatar for crapodino
0
116
Member Avatar for savio_1987

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

Member Avatar for WaltP
0
197
Member Avatar for silentdragoon

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 …

Member Avatar for Dave Sinkula
0
111
Member Avatar for Esmerelda

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 …

Member Avatar for Esmerelda
0
129
Member Avatar for jordanspy

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

Member Avatar for Salem
0
79
Member Avatar for Nemes

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 …

Member Avatar for Salem
0
120
Member Avatar for kfupm

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 …

Member Avatar for WaltP
0
93
Member Avatar for silentdragoon

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

Member Avatar for silentdragoon
0
152
Member Avatar for Barefootsanders

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 …

Member Avatar for WaltP
0
97
Member Avatar for csteverun

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 = '*') { …

Member Avatar for csteverun
0
150
Member Avatar for dv1r

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 …

Member Avatar for dv1r
0
182

The End.