19,876 Topics
![]() | |
Consider this function: double find_distance (const stud &pnt_1, const stud &pnt_2); stud is a defined structure. What is the point of calling pnt_1 and pnt_2 by reference if 'const' is included at the begginning, making the value remain constant? I mean, when we call by reference, its only to change … | |
Iam suppose to make a program that creates an employee database of names, addresses, and phone numbers. the user to search by name for an employee in the database. if the name is not found output a message to that effect. so far I have this but its giving me … | |
I have to make a C program read ordinary text (a sequence of lines) from the program's standard input, and print it with each line reversed from left to right. It has to be no longer than 80 symbols and it should read until it gets an EOF. Im stumped … | |
[i]editing function messed up this post. For more information, feel free to PM me. Sorry about that! --alc6379[/i] | |
i've been reading a lot of the posts here to help me learn C. the problem is, much of the code is written for other compilers (i use gcc). i didn't know there was compiler-specific code until i tried to compile code from questions asked here. this seems so backwards, … | |
SHORTEST-JOB-FIRST , PRIORITY , ROUND ROBIN I need the idea of each of the above algorithms as flow chart??? please help me | |
Hi! I am developing a project in which i want to run 2 programs simultaneously in such a way that when the user runs 1st program,the 2nd program gets called from the 1st program and now both the 1st program and the 2nd program start executing simultaneously. For ex :Suppose … | |
I have to make an assignment for my class I ve done 9 assingments already but this one got me lost. How can I do it? New concepts reinforced: Pointers 1. Create the function GetEmployeeData. 2. Call the function above passing as arguments the addresses of Name, Id, RateOfPay, and … | |
This is the code I wrote for a calculator in C #include <stdio.h> int main (int argc, char **argv) { int i; int value; int total; char operator; total=atoi(argv[1]); for(i=2; argc>i+1; i=i+2) { operator=argv[i][0]; value=atoi(argv[i+1]); if(operator=='+') { total=total+value; } else if(operator=='-') { total=total-value; } else if(operator=='*') { total=total*value; } else … | |
Hello, I am trying to write a tee filter in C language, almost like the UNIX utility. But I have no idea where to begin can anybody give me a direction I should start in. | |
I am taking a class in C and I am having a problem bringing an int through scanf. I have to create a function that will check a date in this format (MMDDYY). So I have set up a scanf for the users input and then I bring it into … | |
hi, in turbo C the maximum array size i am able to specify is array[250][250].. what should i do to enlarge this size to say..array[512][512].. i dont know a thing about memory allocation, so please help me out/.. :-| | |
Hey everyone. Been doing C for a little while now and this website has helped me in advancing my knowledge and skills in C programming. I have another question now... it's really bugging me actually... I'm trying to make a program basically just encode and decode. It seems too simple … | |
Ight im kinda stressed now i have this program due in like 3 hrs but im gonna turn it in late! I would show you my progression but its just the frame work of my thoughts and nothing on it answers my question. I have to creat a calendar using … | |
this is the beginner again how do u display one of three user-selected shapes, ('T'=triangle, 'D'=diamond, or 'R'=rectangle and 'X' to terminate). using a switch statement. please help me with the following. prompt user to choose a shape, using a switch statement, then, choose the appropriate code/function required to prompt … | |
im studying programming fundamentals..I dont know what is the commands and syntax of c language, pls can u give me some definition and information about c language...thnks!!!!!!!!! ;) | |
I know it refers back to variable but I have never seen it used before, could someone please explain :o void change_item( diner * d, float *total ) { int item_num, quantity, new_item_num, new_quantity; float price; display_items(d); do { printf("\nEnter item number to be added : "); scanf(" %d", &item_num … | |
Is my code correct??? I would like to find the percentage like for example: 30pcs of 60pcs is 50%. But how do I code it??? I mean, how to code to get the PERCENTAGE... Is the formula: (num/total) * 100 ??? Is this correct: [code] for(x=0;x<3;x++) { y=total[x]; p[x]=((float)(y/grand))*100; } … | |
Hi All, In one of my project, I need signed Key Algo. As crypto always go miles over my head. So if any provide me nice pointer or source code. Let me explain looking for this type of thing. Using user name (any name) I generate the Keythat key I … | |
guys, i need your help. please... i need to make a function which compares 2 values if they are equal up to 1,2,3,4,5 significant figures. it needs 3 parameters: x1, x2 (the values to be compared) and sf (the # of sign. figures) i think i need to subtract x1 … | |
I am trying to get a program to draw a sine curve (from 0 to 2pi). It takes 8 lines to draw the complete curve. However, the user can choose to use up to 100 lines to make the curve smoother. How do I get the program to calculate that? … | |
Ok, for a lab I have to write the UNIX more filter in C, but I have got everything done execpt one thing. I only hvae it to where it can read 20 lines at a time. But what I want to do is if argv[1] == -Pxx where xx … | |
plz help to give the code of finding mode 1 2 1 4 2 2 2 2 6 8 5 4 | |
Hello everybody! My name is Given and I'm new to these Forums. I have been given an assignment by my c programing teacher and I don't know where to start can somebody helpme? I have attached my question here. | |
Hello, I have a project which involves basic implementations of linked lists, in C. First though, I have to read the information from a file, which contains all different types(int, char, float) which is my problem...after i read the information into the nodes, it should be smooth sailing.. I was … | |
I go to make my program and I get those warnings. I know that they are linked to the exceptions my program throws during execution which terminates my program another godamn debug error. The problem is that when I double click on the warning, it brings me into the complicated … | |
Hello All I am new at this website and I hope I can be a good memeber. I have a question about C programing language. I need to change the decimal point of a double for example: If I have a doubles with 5 decimal digits 123.45678 234.12345 34.34567 I … | |
I have done a bit of physics programming and linked lists before. Anyone want me to post a tutorial on it??? would be about single / doubley linked lists, a bit about quick searching and simple particle physics if any1s interested...? | |
[B]Intro[/B] [i]This tutorial provides a brief introduction to C++ data types.[/i] [b]What is a data type? [/b] When we wish to store data in a C++ program, such as a whole number or a character, we have to tell the compiler which type of data we want to store. The … | |
Hello everybody!I am a new to C.My lecture asked us to write a program with pointers.But I do think I get stuck on pointer's stuff.Can anyone please do me a flavour?It is kinda urgent stuffs. The following are the questions: Write a program to dispense change.The user enters the amount … | |
I can't figure out how to keep it from running off the array and going crazy. I tried a few functions, but they either get rid of my output or funk it up. I want the knight to be a 3 the kill spots a zero and everything else a … | |
Can anyone help me on strings??? I am a newbie and I have a problem dealing with string(school thing). ---------------------------------------------------- A program that checks if the substring "the" exist in the string inputted by the user. * Use a function for checking. ----------------------------------------------------- I'm in a big trouble right now... … | |
[img]http://www.computersforpennies.com/error.gif[/img] testing wether this post works, trying to host the image from my site since i dont know how to do it using his form for threads [B]If the image shows, could you tell me what that debugging error means[/B] | |
[code] Graphics In Pixel Part II B 'Realization of an Enigma' [/code] Introduction ------------ Life's unfair, writing good tutorials take a lot of time, not typing it, but thinking up the content does. Life's fun too, I had quite a good time learning new stuff. My hobby at present is … | |
I am trying to write a program that takes a series of numbers input by a user and performs some calculations on it. While I have most of the code put together and working perfectly fine, I haven't been able to write code that will refuse the users input if … | |
Does anybody have a source code for the MORE filter used on Linux, because I am curious as to how it works. | |
Hi, i'm working on assignment i did part of it and i need help in some functions which are : add(Ta) and remove(int i)// an exception is thrown when adding a duplicate entry or when deleting with an out of bound index i . the instructor gave us the main … | |
if: static char s2[]="Catbert"; static char s3[]= "Ratbert"; what is the vvalue of strcmp(s2, s3)<0 "Please explain" | |
I have this program but a liitle confused about getting the loop to work. i have to write a program that inputs a text and a search string from the keyboard. using a function strstr locate the first occurrence of the search string of the line of text, and assign … | |
The Absolute Beginners Guide to C by Greg Perry. Its been very easy to understand so far, im on chapter 3 so far, as I only read on a day. I have to say he did a great job putting the book together, its published by SAM's but not all … | |
I have to identify which element in the array the highest and lowest numbers are. I have finished the rest of the project but you can see that i need help with the element position. Here's what i have and thank you, thank you, thank you #include <iostream.h> #include"apvector.h"//didn't inclue … | |
Hi I am using a recursive map. The class and data structures are given below. While trying to insert a node in hash map I am getting unhandled exception. typedef struct Item { char *text; char *Id; }ITEM; class Node; typedef class Node NODE; class Node { public: hash_map<const char*,NODE … | |
I need help with an initializer issue -- the following code works well: extern int i1, i2; typedef struct { char ch; int * * array; } qq_str; static int * a[] = { &i1, &i2 }; qq_str qq = { 'c', a }; However, I would like to remove … | |
Greetings everyone... I'm new to Standard Template Libraries thus I'm encountering problems now and then... I managed to get some examples on integer lists to work but the string lists give me nothing but grief... What I'm trying to do is to read a series of words from an input … | |
Hi Everyone I have to write a grep program in C and I am not sure where to start. :?: I need to use strstr() from the standard library, and get it to work; but I dont know how to do that. And that's only half the program, the second … | |
Hi everbody! Sample problem: program1 has a poiter that point to a block memory in PC memory. program1 write the address of block memory (the pointer) in hard disk. program1 still run. program2 start. program2 read the pointer (address of block memory) in the hard disk. Now program1 and program2 … | |
How does the following print?: #include <iostream.h> #include <string.h> void main() { char s[50]; strcpy (s, "What "); strcat (s, "does this " ); strcat (s, "do?"); cout << s << endl; } Can you explain? | |
Man! I totally forgot the code this SORTING thing and now, I don't know how to do it again. I think having a vacation from programming was a bad idea... Any help contributions??? please... Here's the problem : ----------------------------------------------------------------------------------- A program that sorts the ten (10) input values either in … |
The End.