15,552 Topics
| |
Hello to everyone,I'm using a Borland BCC55 compiler to describe the logarithm function. It works fine,but only with numbers higher than 1,if I insert any floating point the result stucks on -46,whatacer number <1 I write. Here is the function,I made it myself (on a text host): [url]http://freetexthost.com/kv0rdi4gno[/url] Of course … | |
Hi, I am working on a project, I need to control a CD Drive via the IDE/ATA Interface using a C/C++ program. My goal is to control the Speed of the Drive, and hopefully the radial position of the optical pickup head. I am still fairly new to this field, … | |
Hi, I am trying to send data over wifi using socket. I am working Ubuntu. The data to be sent is received from a device over serial port. I want to create a virtual serial port which will read data from a file and present it in way serial port … | |
Hail! Wise and Glorious Gods of C Coding. I have written a little function to search an array and it is cousing the program to hang after I enter the search criteria,It should should the array for a match and then return the whole string it was found in. There … | |
Hello I want to have a code which gives a random value faster than a value per second. Here is my code: [CODE]#include <stdio.h> #include <stdlib.h> #include <time.h> int main() { int x; srand(time(NULL)); x = rand()%100 +1; printf("%d", x); return 0; } [/CODE] Can you please tell me how … | |
Helo, I need calculete Spaces in file. Maybe can write this function. Thank you P.S Sory for may english | |
Hi, I am trying to send data over wifi using socket. I am working Ubuntu. The data to send i receive from a device over serial port. I want to create a virtual terminal which send which act as serial port sending data from a file. Can anyone help me … | |
Hello, I have a question, if you please. I have been trying to fill an array with values from a text file for hours. I has been 12 years since I have used any C code, and I thought I would be able to remember this. I have an opportunity … | |
Hi all, My code is giving the desired o/p, but at the end its producing segmentation fault. (I know this is very column and also I have checked other posts, but couldn't understand the solution) Here is my code[CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include "blake.h" int genShortMsg(int … | |
void main() { int i=1; printf("%d,%d,%d",i++,i++,i++); } output 3,2,1 CAN SOMEONRE EXPLAIN ME WHY? | |
how can i get already written code for a particular program? | |
Hi all, the following code prints garbage values. I want to read from an array two bytes and print then as a short int after doing ntohs. What is the bug in the code? Thanks and Regards, Prashanth [code] #include<stdio.h> struct converter { unsigned short int i; }; main() { … | |
[code] main() { int i=0xff; printf("\n%d",i<<2); } [/code] please tell me how to work out this code... and what will be the output... | |
I am tring to pass an array to a function but when i compile it says array undeclared first use in function.i thought once i pass it as parameter it becomes known by the function.here is my code: /* Write a program that reads quizzes from a file 'q.txt', randomly … | |
I have a question about functions and pointers to functions.... Why does a C program treat a function call to a function and a function call to a function pointer the same? [CODE] #include <stdio.h> #include <stdlib.h> typedef void (*funcptr)(void); void myfunc(void) { fputs("Hello, World!\n", stdout); } int main(int argc, … | |
hi, I have some problems with winsock library so I am calling loading it dynmically then calling the functions so far so good,but the problem is for example I see in the winsock2 header files that - GetHostByName and some other functions are which I use there prototypes is kinda … | |
Hello, i need to do a program which takes an input sequence of characters from the alphabet {A,B,C} and compresses it by replacing each subsequence of a particular character by a single occurrence of the character, and the length of the substring. e.g. Input : AAAAABBBBBBBCCBBBAABBCCCCCS Output: A5B7C2B3A2B2C5 i dont … | |
i need a detail explanation about left shift and right shift operators in c..its very hard to understand it..especially when i am using shifting on hex and oct values...seems to quite confusing me...i got the output..but i dunno how it comes...please clear my doubts.. thank you | |
My English is very poor...there must be a lot of mistake in my expressions. but It would be very kind if you can answer my question... 3Q. In c compiler ( vs 2010 express c++), I tried the code as follow, 0 error 0 waring. In C++, it is the … | |
Hi, I want to read ctrl-c ctrl-z values from serial port. is there any ways to read? Regards Yuvaraj | |
whenever i run this code: [code=c] void _freecommands(void) { command_t *com; for(com = cmd.commands; com->name; com = com->next) free (com); } [/code] i get one, even though i've malloc'd them previously and the conditional statement checks if they're not valid i don't understand why, can someone help me? | |
I'm reading in a text file that contains a little custom script. However, one line of that script gets ignored and I can't figure out why. Script: [CODE]# Test Case #1 - Simple Movement RESET FORWARD 2 PAUSE 1 REVERSE 2 PAUSE 2 TURNRIGHT 2 PAUSE 1 TURNLEFT 2 PAUSE … | |
Hello guys, i am making a simple test using select() for a future program i must do. What i'm trying to do is very simple, i have a client, and a server. The client listens to both stdin and sockfd using select. The objective is as follows: If i write … | |
when i run this code, f is being set to null and i have no idea why.. i know for a fact that cmd.argv(1) at that point is "vars.rc" because i debugged it with breakpoints. [code=c] FILE *f; if(cmd.argc() != 2) { con.printf("writevars: <filename>\n"); return; } f = fopen(cmd.argv(1), "w"); … | |
Hi, So I'm new to C and I'm trying to get the max temp from my user input and the print out in a table the temperature's from 0 to max temp in celsius and fahrenheit. However I can't seem to get the maxtemp from my getinput function. I was … | |
[code]main() { int i, j; scanf("%d %d"+scanf("%d %d", &i, &j)); printf("%d %d", i, j); }[/code] i have doubt in this program where we are using 2 scanf statment which is nested one...y we are using +scanf..is this corect?? if so please expalin it.. | |
Hi, Everybody, I wrote the program to connect to the Microsoft Sql server 2000. I have also defined constrains and triggers on Tables of SQL. Now I want to catch the error message generated by the triggers or constraints in c prog and want to show it to user. Can … | |
how I can simplify fraction after do some process on it (add, sub...) this part of program (add fraction) [CODE]int i,j,k,m,a,b,c,d; char x; printf("Please Enter fraction number 1\n"); scanf( "%d%c%d",&a,&x,&b); printf("please Enter fraction number 2\n"); scanf("%d%c%d",&c,&x,&d); if (b == 0 || d == 0){ printf("undife number\n"); system ("pause"); } else … | |
[CODE]return((int)ADHR << 2);[/CODE] im trying to learn what a certain function does and then i stumble upon this part. i do get that << 2 means shift left by 2. what i do not know is the (int)ADHR part. can anyone help me out with this? thank you | |
i have a 2D matrix of characters or integer or whatever!How do i check if another matrix is a sub-matrix of The 2D one ...Please!! help with simple code that work for any size of the matrices Thanks in advance to all |
The End.