18,490 Topics
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 …
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 …
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; …
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 …
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 …
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 …
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; …
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 …
[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 …
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 …
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 …
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] …
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 …
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 …
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; …
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); …
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.
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 …
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 …
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 …
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, …
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.
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 …
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 …
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 …
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 ?
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 …
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 …
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.
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?
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 …
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 …
i need the c program code for controlling trafic signal using graphics can any send the program
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
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 = …
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 …
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 …
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 …
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 …
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 …
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 …
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 …
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 …
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 …
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) ; …
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 …
[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 …
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.
The End.