18,490 Topics
Is &(&z) ever legal in C? please give an example, i'm having a hard time understanding this.
I created this function and I need help turning this into a recursive function [code=c] #include "stdafx.h" #include "stdio.h" int fact (int n); // function prototype// int main (void) { int n,result; printf("please enter a positive integer"); scanf("%d", &n); result = fact(n); printf("The answer is %d\n", result); return 0; } …
Hi like to write a program that can take arguments like %program -t <type> <path> <path> <name> where -t follow by type is the file type I like to look for in a find program, and path's is where I want to look, followed by the name of the file …
Hiii there... I have programmed a scientific calculator using C which performs every single task dat a hi tech calci can perform.. It stores all the calculation dat u performed on the day.... i am using a .txt file to store d calculations But the problem arises while retriving the …
hi guys, working in C using Borland Compiler we can get scan codes of keyboards keys by this code [code] ch = getch(); if (ch == 0) ch = getch(); printf("%d",ch); [/code] because when first time getch() is called, it will return the ascii code of the pressing key. when …
[B]Can someone provide me with a short list of the hardware requirements to implement a beta test version of a proposed search engine to be coded in C++?? What hardware will be required just to determine if the logic behind this architecture accurately returns the searcher's intent? As a startup …
Hi frnds, i have been programming for abt a yr now n used to consider myself gud wid c programming until i chked out this forum.... Some of U guys are fantastic. So i wud appreciate if ne cud gimme topics on c programming dat will hlp me hone my …
Hello, I am trying to do a recursive function using fiboncci. I have been working on this and it is not working. #include "stdafx.h" #include "stdio.h" int fib (int n); // function prototype// int main (void) { int num, result; printf ("Please enter a positive integer\n"); scanf ("%d", &num); result= …
Hello dere! I am a maybe I.T., MSc from AIU, LA. Taught compter subjects MS apps, Oracle, basic C. Wanted to be a programmer, got the schooling, but never the skill. I am 61. I like to write. I am from Chicago, living in Long Beach, CA. In a nutshell.
hi everyone... i am Sachin...presently in my third year pursuing b tech in computer science from India...my potential area of expertise is Artificial Intelligence...and i am looking for some project for my summer internship...i am fluent with c, c++, j2se...if someone can help me in this then kindly reply...
This program is a double-linked list in C for my System's Software class. Everything worked fine, until I coded the delete() and insert() functions. The program compiles and executes on a window machine using Dev C++. It also compiles without any errors or warnings on a linux machine using gcc …
Hi, I am allocating memory for some areas. For DB i need 1024 bytes, for DS 1024*2 bytes and so on, and i initialised address as follows. I initailise devBaseAddr to DB, because DB comes first, and next DC. DB is 1024 bytes , so for DC=DB+1024. This is DC address. …
Hey, What I am looking to is this: Receive 32 bytes of data from serial port into an array. ( This I have done already) Now based on say the second byte in the first 32 bytes, i will know the size of the entire packet I need to receive, …
I am trying to combine byte values into a long variable. I have four bytes each in an unsigned char: unsigned char a = BC; unsigned char b = 1E; unsigned char c = 04; unsigned char d = 00; I want to have it so I can put the …
can someone help me? Still confused in linked lists. there's something wrong when I input a record for the 2nd time. it sometimes works but then when I display all records It doesn't display correctly. here's the code... [CODE=c] #include<stdio.h> #include<conio.h> #include<stdlib.h> #include<string.h> typedef struct node *nd; struct node{ int …
Hi, I am new to C++.Pls help me out.would really appreciate it. The problem goes like this. There are two files. In file1(say data1.txt)u have got something like this Line1:Hello How Line2:We are fine the work is grab each string and assign it with a binary file and enter it …
I am trying to load the bmp image from my C to the console and it works. The image opens. But the problem now is the console hangs. Is there something wrong in my code? Or what should I change to avoid making the console hang. [CODE] #include <stdio.h> #include …
I'm to this whole modularity thing. We were asked to do our own libraries .h and .c files and to call them in main. The main objective of the program is to compare bubble and select sort. So far, I have all the libraries along with their respective .c files. …
Thanks [CODE]#include <stdio.h> #include <stdlib.h> struct Node{ int data; Node *link; }; typedef Node* NodePtr; void addToEnd(NodePtr* head, int val); void printList(NodePtr head); NodePtr mergeLists(NodePtr* list1, NodePtr* list2); int main() { int nextInt; NodePtr list1 = NULL; NodePtr list2 = NULL; printf( "Enter integers in sorted order for first list, …
help. I do everything in C++ with STL but I have to utilitize legacy C functions within my member functions (methods). The legacy C function signature is... extern int UF_DRF_create_label( int num_lines_text, [B]char text_string[ ][132+1][/B] , double origin_3d[3], UF_DRF_leader_attach_type_t leader_attach_type, UF_DRF_object_p_t object, double model_pos_3d[ 3 ], tag_t * label_tag); My …
I have made a function that detects F1 key at the end of the program and starts it again. But what I wanted was that even if user is in the middle of the program when the user presses F1 it immediately restarts the program. Here is my code: [code] …
Can anyone fix my code especially in the updateRecord function because instead of updating,data remains the same. [CODE]int newRecord( FILE *fPtr ) { /* create clientData with default information */ struct clientData client = { 0, "", "", 0.0 }; int accountNum; /* account number */ /* obtain number of …
Hi guys I have a small problem. It could be not enough information to obtain the right answer but I will try. So I have a problem regarding liked lists. It works perfectly fine when is compliled under Windows using Dev-C++ compileer. But when I try to complile under Unix …
I want to use getimage function to store the image in memory but cant ,please help me
I want to write some programs and even games using graphics of C.Please Help me to write these.
Hi everyone, Need a small help. I need to read the data from stdin (standard input) without hitting enter. Need to read the data as in and when they are typed in until EOF (CTRL + D as I am using UNIX) is encountered. I tried, getc() - requires ENTER …
here is Shail, i am doing my Engineering in Information Technology. i just love coding in C. i am learning other languages and picking up interest in it.. would love to learn about Database management system and networking.... hoping to have a great time here
pls help me with my code! it wont align! T_T i cant get it to work correctly! pls help guys! heres the screenshot! the date wont align huhu! [IMG]http://img72.imageshack.us/img72/4647/helprk3.jpg[/IMG] [code] #include<stdio.h> #include<string.h> #include<conio.h> int getNumberOfDays(int month,int year) { switch(month) { case 1 : return(31); case 2 : if(year%4==0) return(29); else …
I need help with program i cant find a way to get rid of the error and if i think a little bit more my head will explode this is a 2day program for me [CODE]#include <iostream> #include <stdio.h> #include "simpio.h" #include "strlib.h" #include "random.h" #include "string.h" using namespace std; …
Can anyone help me make a pseudocode for this function....cause its really difficult:'( [CODE]int updateRecord( FILE *fPtr ) { int account; /* account number */ double transaction; /* transaction amount */ /* create clientData with no information */ struct clientData c = { 0, "", "", 0.0 }; /* obtain …
I am trying to write some information out to a file. I have a string in hex values and I need to write this out to the output file. The hex string I have is 4b70 4772 64. The string equivalent is KpGrd. I have: char a[] = "4b7047726400"; Then …
can anyone show me how to go about this. I've been trying to use a log to base 2 in c. the code atually works but it requires me to type in a char after typing the number i'm getting the log of [code=c] #include<stdio.h> #include<limits.h> #include<math.h> void main() { …
Write a program that inputs a line of text and uses stack object to print the line reversed. I found this C question in: [url]http://abhaygoel.wordpress.com/c-dac-ent[/url]... I have difficulty to solve it, anyone can help!
Hi everyone! I'm kinda n00b in C/C++, All I ever did were some basic programs for some .txt files manipulation. Last time I was working in BC 3.1, about for years ago. Now I got Borland Turbo C++ Explorer 2006 and is a little hard for me to start a …
what dose the error " Null pointer assignment" means and what causes this error?:idea:
Hi, After calling make using the makefile bellow i receive .o and .p files. but in the linking part i receive errors : undefined reference to.... thhe makefile: CC=gcc -c LD=g++ SRCS= a.cpp b.cpp tmp/c.cpp tmp/d.cpp............ OBJ=$(SRCS:.cpp=.o) INCLI= ... all: BBB BBB: $(OBJ) @echo "Linking...." $(LD) $(OBJ) -o BBB $(OBJLIBS) …
Write a program that prompts the user to enter a hexadecimal value. On the next line, display the binary equivalent. If no hexadecimal value is entered, display “INVALID”. The Execution should look like this: Enter a Hexadecimal Value: 0B Binary: 00001011 [esc key terminates the program] Enter a Hexadecimal Value: …
I'm completely new to C & need some help =( I want to make this clear.... This is a homework project that I'm stuck on so if you feel this is "cheating" then sorry for "offending" you. How can I change the tax rate in the executable file? This is …
Hey Guys, Can anyone tell me hoe to use database connectivity in C or C++. Any web links would be better.
hey guys..I'm trying to teach myself to writee code using C. The program I am working on now is to write a program that prompts a user for his/her age and then prints a message based upon the age range that the user’s age falls into here is the age …
[url]http://www.talklikeapirate.com/piratehome.html[/url] Here be a FAQ for ye all. Q: What's your favourite data structure? arrrray's me hearty! Q: Which virus scanner do you use? Avast!, and ye be free of the vermin. Q: What's your favourite syntax? Arrr, that'll be the main brace to keep your program on a steady …
I have some simple questions: 1) How can I restart my program immediately. For example, when the user press F12 it will restart immediately even if the program is not complete. 2) In scanf the problem is: for example: Height Width enter the perimeter: 2 3 < the Cursor moves …
What's the preferred way to pass a string to and from a function?
Hi y'all. I was wondering if someone could help me out a little bit. I have a couple problems due in my Scientific Programming class, and I am fairly lost. I posted another question in the C forum, but I think I was able to solve it on my own. …
Hi Gang! I am new to the forums, and programming in general, so I apologize forthright if I am slow or just plain dense on anything/everything. With that disclaimer gotten outta the way, I have an assignment and I am not sure what exactly how to execute it. The problem …
It's a FizzBuzz question designed to "separate the men from the boys", so don't cheat. :) Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are …
Hello, I am trying to incorporate the use of a batch file towards my program. For this I just want that after the program has starting running to send the file content's to stdin, in which case the program should do the rest? Is this possible, how so? Or should …
Hi There, I have a piece of code that is confusing me and would appreciate any advice: Reg1 is an 8 bit register Bit0 is bit 0 of Reg1 Line of code that I am having trouble understanding: Reg1 &= ~(1<<Bit0); This is what I think the answer is: Asume …
h! friends i am not gettin output for below program.. it shows [B]segmentation fault[/B]...:-O can any one suggest me on this.... [code=c] #include<stdio.h> #include<string.h> int main() { char *str1="United"; char *str2="front"; char *str3; str3=strcat(str1,str2); printf("\n%s",str3); return 0; } [/code] thanks:)
Can anyone add some codes in my program so that it could output a receipt which would display the name of the items bought with their price..:) [CODE]#include<stdio.h> int item_details (); int payment (int x); int add_item (int x); int main () { int choice,price; printf("Enter 1 to buy.\n\n"); printf("Enter …
The End.