15,551 Topics

Member Avatar for
Member Avatar for fussballer

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

Member Avatar for rajeevpareek
0
260
Member Avatar for 234pramod

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 …

Member Avatar for Nick Evan
0
77
Member Avatar for hasbeenbad

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 …

Member Avatar for Greg8202
0
113
Member Avatar for newbiecoder

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 …

Member Avatar for newbiecoder
0
124
Member Avatar for Xpress2010

Helo, I need calculete Spaces in file. Maybe can write this function. Thank you P.S Sory for may english

Member Avatar for UncleLeroy
0
96
Member Avatar for 234pramod

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 …

Member Avatar for 234pramod
0
118
Member Avatar for hasbeenbad

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 …

Member Avatar for Adak
0
1K
Member Avatar for arpanm

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 …

Member Avatar for arpanm
0
134
Member Avatar for Sukhbir

void main() { int i=1; printf("%d,%d,%d",i++,i++,i++); } output 3,2,1 CAN SOMEONRE EXPLAIN ME WHY?

Member Avatar for sanagopi
-1
232
Member Avatar for omiyehan
Member Avatar for sanagopi
-1
75
Member Avatar for prashanth s j

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() { …

Member Avatar for prashanth s j
0
192
Member Avatar for sanagopi

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

Member Avatar for Banfa
0
2K
Member Avatar for melusim

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 …

Member Avatar for terminato
-1
236
Member Avatar for gerard4143

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

Member Avatar for gerard4143
0
173
Member Avatar for MrNoob

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 …

Member Avatar for UncleLeroy
0
96
Member Avatar for manutd4life

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 …

Member Avatar for manutd4life
0
162
Member Avatar for sanagopi

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

Member Avatar for sanagopi
0
129
Member Avatar for niyujin

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 …

Member Avatar for gusano79
0
198
Member Avatar for yuvaraj.ragupat

Hi, I want to read ctrl-c ctrl-z values from serial port. is there any ways to read? Regards Yuvaraj

Member Avatar for yuvaraj.ragupat
0
75
Member Avatar for tomtetlaw

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?

Member Avatar for Radical Edward
0
57
Member Avatar for idlackage

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 …

Member Avatar for Radical Edward
0
96
Member Avatar for rai32

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 …

Member Avatar for rai32
0
308
Member Avatar for tomtetlaw

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"); …

Member Avatar for tomtetlaw
0
2K
Member Avatar for tam13

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 …

Member Avatar for aspire1
0
105
Member Avatar for sanagopi

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

Member Avatar for Adak
0
88
Member Avatar for Him3

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 …

Member Avatar for monu chauhan
0
475
Member Avatar for Neen14

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 …

Member Avatar for wildgoose
0
123
Member Avatar for iwanttolearnc

[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

Member Avatar for iwanttolearnc
0
100
Member Avatar for Alerwiali

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

Member Avatar for Alerwiali
0
64
Member Avatar for Ferny84

I'm supposed to ask the user to enter a number of marks, and to decide what each mark is. Then my program is supposed to find the min and max in the array, so far this is what my code looks like: [CODE]#include <stdio.h> void findMinAndMax(int arrayMarks[], int numOfMarks) { …

Member Avatar for Ferny84
0
132

The End.