18,490 Topics

Member Avatar for
Member Avatar for ahamed101

Hi Everyone, I know conio.h is not available in Unix. I want to use getch(). Using curses.h needs causes the screen to clear which I don't want. I found a code snippet (source : internet) using termios, it works, the thing is I need to press enter/or any other key …

Member Avatar for ahamed101
0
1K
Member Avatar for jared_masc

Hi, i'm really new to programming in C, and iam kind of stuck on this problem, the question is [B] Write a C function to print out an integer value in base 4 (using only the digits 0, 1, 2, 3). Use this function to write a program that reads …

Member Avatar for ArkM
0
132
Member Avatar for rrreeefff

Hello, I am working on a non-recursive function that computes a to the power n. I have one error which is cpp(23) : error C3861: 'mypower': identifier not found [code=cplusplus] #include "stdafx.h" #include "stdio.h" double power(float a, int n); // function prototype// int main (void) { float a; int n; …

Member Avatar for devnar
0
522
Member Avatar for RouseA

I am trying to define peripheral ports in an embedded application as variables at fixed addresses (e.g. PortA is at address 0x10010). I could do this using #define: #define PortA *(u32*)0x10010 However, this wouldn't allow me to view the value of PortA in a watch window when debugging, since there …

Member Avatar for Salem
0
174
Member Avatar for totalnoob

Hi! As you can see by my name I'm new to programming. I have a program that only works partially. It consists of two functions. One function creates a text file and reads it and the other one creates a binary file and reads it. The text file part works …

Member Avatar for totalnoob
0
99
Member Avatar for En-Motion

I have to write a program where a user trys to pick a number. The code i've written below always exits after 2 guesses abd says the guess was correct even if it's wrong. Can anyone see what i'm doing wrong? Thanks [code]# include <stdio.h> # define NUMBER 50 int …

Member Avatar for En-Motion
0
114
Member Avatar for mikeregas

I need this to been done recursively, it works but I was told that it is not recursive does anyone have any ideas or suggestions [code=language]#include <stdio.h> #include <string.h> #define TRUE 1 #define FALSE 0 main () { char decision; char str[30]; int isPalindrome = TRUE; int choice = TRUE; …

Member Avatar for ArkM
0
154
Member Avatar for mikeregas

my question here is two fold I am new to recursion and I am not going to lie. I dont get it at all, well at least the code part. is this considered recursive? and the second question is how do I make a loop that would let the user …

Member Avatar for stilllearning
0
89
Member Avatar for patricksquare

[code=c] x=0; t=0; int t2=0,t3; while(t<=ref) {t3=t2; for(x=0;x<jbn;x++) { if(t==cpy2[x].at) { if(q>=cpy2[x].bt) { t2+=cpy2[x].bt; tt[x++]=t2; cpy2[x].bt=0; qq++; } else if(q<cpy2[x].bt) { t2+=q; cpy2[x].bt-=q; cpy2[x].at=t2; qq++; } } else break; } t++; if(t3==t2) {t2++;} }; [/code] assuming the values are cpy2[0].at==1 cpy2[0].bt==2 cpy2[1].at==2 cpy2[1].bt==3 cpy2[2].at==4 cpy2[2].bt==4 q==2 qq is just an …

Member Avatar for WaltP
0
122
Member Avatar for haris76

Hello bros, pls help me to find link for my assignment below is the criteria : There are two major categories of computers: CISC-based computers and RISCbased computers. Choose two different kinds of computer systems from CISC-based category and RISC-based category, respectively (total 4 systems). Compare the organisation of the …

Member Avatar for Denniz
0
276
Member Avatar for mikeregas

here is the code that I have so far and I can not seem to get it to work properly it is return 1 for any number that is entered. Any help that you can give me would be greatly appreciated. Thanks [code=language]#include <stdio.h> double square_root(double low, double high); int …

Member Avatar for chrissygirl
1
2K
Member Avatar for chrissygirl

hey guys, im trying to write a program recursively that takes in how many times the user wants to flip a coin, and prints out all the possibilities. i am having a hard time figuring it out. id apreciate some input. here is the code i have so far... [code] …

Member Avatar for tessen
0
275
Member Avatar for amitt

Hi Friends, I am Amit, I registered because this site is very helpful and interesting. I myself is a software engineer, I know C, C++, Html, Dhtml, JavaScript, and C#. I am assure that this site is definitely going to help me. Hi Friends, i am the user of this …

0
11
Member Avatar for adityasaten

hi friends, First I want to introduce myselt, I am Aditya and have little knowledge of programming because I have enter in this field just os i face problem with c and need your kind solution, your reply would much valueabel for my bright future... I have a problem in …

Member Avatar for abhijeetcn
0
137
Member Avatar for J-son

Hi there ... I need help with the following program.It is giving me error. Thanks very much. [CODE=c] /*Write a structure function to enter Roll number, Name, Department, Course, Year of joining and print them out */ #include <stdio.h> struct student { char name; char dep; char course; int roll; …

Member Avatar for abhijeetcn
0
171
Member Avatar for rrreeefff

Hello, I need to modify the following function to compare with the library power using power (double, double) [code=c] #include "stdafx.h" #include "stdio.h" double mypower(float a, int n); // function prototype// int main (void) { float a; int n; int power; printf("\n enter a value of a\n"); scanf ("%d", &a); …

Member Avatar for Aia
0
88
Member Avatar for tatainti55

Why do i get this error every time i try to compile an SDL source code? D:\gcc installation problem, cannot exec `cc1': No such file or directory. That's the ONLY error i get.

Member Avatar for tatainti55
0
167
Member Avatar for rob_xx17

hello, I'm trying to write a simple program that proves mathematical theorems (predicate calculus). What I need to do is to have a small database that holds all of the propositions ('abc'; 'b'; 'cde'; etc.). What I'm having a problem with is creating a function that would act as a …

Member Avatar for Salem
0
122
Member Avatar for rob_xx17

Hell, This might be a big vague, but I hope that someone might be able to help me. I have a program that does virtual simulation of robotic arm using inverse kinematics. The program works fine but right now I'm trying to collect some data, generated inside the program, into …

Member Avatar for rob_xx17
0
122
Member Avatar for Aus89

I am getting a the warning "assignment from incompatible pointer type" when compiling my code, I have spent ages trying everything I can think of, but I am not very experienced at using C so it is probably something really simple that I just can't see. I have commented the …

Member Avatar for Salem
0
2K
Member Avatar for simply_vheng

i need some guide.. i'm a new member here. this is my first time to ask for help. i've been working for this code for two days.. but i cant find way to make it better..huhu it suppose to do a "round robin with overhead". its an algorithm.. i think, …

0
63
Member Avatar for tatainti55

How can i run my program for a specific amount of time? And what is threading? I'm really new to C++ so i'd like n00b-friendly answers.

Member Avatar for Freaky_Chris
0
87
Member Avatar for Member #421366

Hi I'm quite new to writing programs in C language. I've been working hard on a program and my output isn't coming out as it should. Problem is you're supposed to enter 7 numbers. The program should sort the numbers in 5 categories of ages. Then calculate the average. I …

Member Avatar for grumpier
0
308
Member Avatar for jendrick12
Member Avatar for jendrick12
0
42
Member Avatar for DogfoodEnforcer

ive been working on the binary to decimal converter program. not having a fun time with it!! this is what i have: [ICODE]#include <stdio.h> #include <stdlib.h> #include <math.h> int main ( void ){ /* variables */ int decimalValue = 0; int counter = 0; int nextDigit = 0; char binary …

Member Avatar for Aia
0
112
Member Avatar for MalloryOMae

I started playing with programming back when psuedocode was being taught in technical colleges... No jokes about my age, PLEASE! I also learned about binary, loops, and even created an even more archaic video game than "PONG" !!! I got real hard core about them back in the late 90's …

Member Avatar for Ancient Dragon
0
105
Member Avatar for san_sarangkar

Hi every body , I got one problem that how can we generate 1 to n numbers without using any loop and without using recursion function ?

Member Avatar for Aia
0
168
Member Avatar for ChroNoS

I am develping a program to create an rtf file.The rtf file will be having images in it that will form a border around the page. Here is the code so far: [ICODE] #include "rtflib.h" #include "globals.h" #include "errors.h" void main() { // Set RTF document font and color table …

Member Avatar for Salem
0
210
Member Avatar for DogfoodEnforcer

Hi there Daniweb, right now im in an engineering program and we are being put through a crash course in C. Ive never dont any type of programming before so it is quite an adventure (to say the least). Currently we are doing an assignment in which we have to …

Member Avatar for Freaky_Chris
0
201
Member Avatar for anuj_sharma

hey Guys, I have completed the basic concepts of C and C++. I want to know whether should i go for file handling and database connectivity or should i go for java. Please help me on this.

Member Avatar for Narue
0
108
Member Avatar for PPP1

Hello, I am little bit confuse for c and c++. All loops are same in both the languages so why they are different for each other?

Member Avatar for Narue
0
183
Member Avatar for intsoda

Hello, I am trying to capture a cd-rom eject request (both soft eject through software or physical button press.... i believe they are the same request) so that I can display a Message Box before the cd-rom tray is ejected alerting the user that an object blocking the cd-rom door …

Member Avatar for intsoda
0
123
Member Avatar for jesie0405

hi, we have this assignment in our computer subject in school. we need to create a c program that converts decimals to base(2-9) and vice versa. i know how the coversion works but i cant perfect my program. here's my program... i know the output for the 1st case is …

Member Avatar for jesie0405
0
91
Member Avatar for drameshcbe

i need the c program code for controlling trafic signal using graphics can any send the program

Member Avatar for Denniz
0
108
Member Avatar for mars key

how can i display : int x,y,p; y=10; p=3; x=y+p; printf(" sum = %d",x); in graphics mode ( graphics.h) or which function can do this job? mars key to mars and beyond Download this as a file

Member Avatar for ArkM
0
136
Member Avatar for plike922

please help... my computer moves wont work. it not an error it a crash or infinite loop. [CODE]#include <stdio.h> #include "strlib.h" #include "simpio.h" #include "genlib.h" #include "string.h" #define size 9 void main() { int rand, x = 0, i, player = 0, turn = 0, row = 0, column = …

Member Avatar for Aia
0
113
Member Avatar for Enriel10

Hi everyone! I need some help about one problem with Matlab and C. I need to convert Matlab code to C code. I have seen that there are an additional part of Matlab called RealTime Workshop that made it but is not free and i heard about Octave that probably …

Member Avatar for DavidB
0
115
Member Avatar for KDizzle

i need help programming pascal's triangle in C. i looked at the old threads, and none of them really helped. its a simple program, so no getch() or anything special. i started to create an array and give each element values. when i tried to run it, my output it …

Member Avatar for josh2
0
160
Member Avatar for badbloodyeyez

Hi, I would like to know how to determine whater a user has logged off, using a software, the software must run at the background so that the user doesnt know. Basically I want to find out if the user hits the log off button as soon as it does …

Member Avatar for badbloodyeyez
0
79
Member Avatar for windell747

Hi, I'm working on a program that models the trajectory of a baseball with drag. The program compiles okay and links okay. However, during runtime I get a segmentation fault. I remember when I was learning how to program in C several years ago that segmentation faults occur a lot …

Member Avatar for aconstantin
0
279
Member Avatar for Simplicity

Hi guys, I'm new to this forum and this is my first post :cheesy: I need help in modifying a "Snake game" program.. What I need to do is **modify the program so that when it starts (i.e. the AVR microcontroller is reset) it displays a message giving the name …

Member Avatar for waxx
0
261
Member Avatar for Clockowl

Is it possible to read a whole file at once with text files, or can I only use fgets and is that the most data I can fetch at any time? (fread() doesn't work on text files, I've experienced and then been told ;-)). Thanks in advance, PS: And suppose …

Member Avatar for WaltP
0
474
Member Avatar for rrreeefff

I am trying to write a recursive function that compute a to the n. here is as far as I have gotten as far as code [code=c] #include "stdafx.h" #include "stdio.h" int power (int n); // function prototype// main() { float a; int n; printf("\n enter values of a an …

Member Avatar for rrreeefff
0
178
Member Avatar for Hacker_517

I have a problem with bulding a program to store a family record, this record consits of : name, birthday, married? and number of child. What is the best way to store this record??? Could you give me some example about some task on this structure : Input name and …

Member Avatar for Clockowl
0
123
Member Avatar for skankest

i'm trying to control four separate lighting arrays using a timer overflow interrupt to control four pulse width modulations. at the same time i want to be able to control the pwm frequencies using serial communication. i'm using a version of pic lite for my compiling and can compile my …

Member Avatar for skankest
0
154
Member Avatar for Clockowl

How would I reuse functions in C? I've tried simply sticking them in a [icode]#include <myfunctions.h>[/icode], but that didn't work... Any (complete) suggestions/links on how to do this? I googled some and found this: [code]The way to write a header file is: functions.h: int sum( int a, int b) ; …

Member Avatar for Clockowl
0
127
Member Avatar for Manibnl
Member Avatar for FumarMata

Hello I have written my program and right now I am stuck in something that I thought that was going to be easy. I have the [B]char buffer[/B], which receives from the serial port some letters and 2 numbers at position 3, lenght 2. I want to extract those numbers …

Member Avatar for FumarMata
0
210
Member Avatar for aoi

[code] t=malloc(sizeof(NODE)); t->lname[i]=ln[i]; t->fname[i]=fn[i]; t->add[i]=ad[i]; t->telno[i]=tn[i]; t->next=NULL; i++; if(*h==NULL){ printf("\nCreating record..."); *h=t; } else{ p=*h; if(p->next!=NULL) { while(p->next!=NULL){ if(strcmp(p->lname[i],ln[i])>=0){ p->prev->next=t; t->next=p; } p->prev=p; } } else { if(strcmp(p->lname[i],ln[i])>=0) { p->next=t; t->prev=p; t->next=NULL; } else { p->prev=t; t->next=p; } *h=p; } } [/code] could help me with my code? i can't …

Member Avatar for ahamed101
0
122
Member Avatar for amith_hrd

Hai, Will any body help me give the source code for accessing the serial port in turbo c. i need to communicate with GSM MODEM. and please explain me about the hand shaking signals. Here the hand shaking singnal should be Hardware.

Member Avatar for Salem
0
102

The End.