49,757 Topics

Member Avatar for
Member Avatar for Farisnet

Hi... I am a bit new to programming, and I'm trying to learn C++. I was wondering if there was a way to copy the contents of one variable into another... So that, for example: [ICODE] int x=5; int y; (Some fancy code here involving x and y); (y=5 but …

Member Avatar for dougy83
0
19K
Member Avatar for nurulshidanoni

what is the =' : left operand must be l-value means? error C2106: '=' : left operand must be l-value [code=C++] #include <iostream> // std::cout #include <fstream> #include <iomanip> #include <string> // std::string #include <vector> // std::vector<> #include <algorithm> //std::for each() using namespace std; // import "std" namespace into global …

Member Avatar for nurulshidanoni
0
433
Member Avatar for moltenice

Assignment - [url]http://condor.depaul.edu/~ntomuro/courses/262/assign/hw2.html[/url] [code]Write a class called Loan, which simulates the money you borrow from a financial institution, and a main function (i.e., an application program) which tests the class. You write ONE file, which should be named "myLoan.cpp". 1. Class Loan The class Loan should have the following members: …

Member Avatar for Agni
0
275
Member Avatar for Moporho

I am trying to solve a problem from a lab challenge. I can not get the program to compile correctly. Please look over and let me know where I need to be looking to solve this Use a two-dimensional array to solve the following problem. A company has four salespeople …

Member Avatar for Moporho
0
4K
Member Avatar for curagea

I have in my code two separate arrays to store values, uCurve and vCurve. Both are arrays of pointers to math vectors: [code=cplusplus]Curve uCurve, vCurve; uCurve[0] = &(bezcurveinterp(cP[0][0], cP[0][1], cP[0][2], cP[0][3], v).p); uCurve[1] = &(bezcurveinterp(cP[1][0], cP[1][1], cP[1][2], cP[1][3], v).p); uCurve[2] = &(bezcurveinterp(cP[2][0], cP[2][1], cP[2][2], cP[2][3], v).p); uCurve[3] = &(bezcurveinterp(cP[3][0], cP[3][1], …

0
53
Member Avatar for Arne Kristoffer

Hi! I have this function (well, it's pretty good explained in the code-tag, but okay.) which is supposed to see if a string is found first in a line in a text file. Anyway, this code gives the message (while running in debug mode in MSVC++): "Debug assertion failed. Expression: …

Member Avatar for Ancient Dragon
0
865
Member Avatar for Jennifer84

I opened the command promt inside VC++ and this solved it. I have encountered a problem. When I compiled a program it came up an Error Message and the VC++ 2008 Express Edition was closing. When open VC++ again and press on my project that I work with. This message …

Member Avatar for Colstel
0
618
Member Avatar for petzoldt01

It has been a long time since I have used C++ (I am only 20, so maybe not that long) I have been using several languages in the last couple years(Java, ActionScript2 and 3, PHP), polluting my mind with many different idioms, and now need to hop back to C++. …

Member Avatar for Ancient Dragon
0
149
Member Avatar for aquariusdragon2

So I know how to delete a descriptor from an array, but I can't seem to edit the code to add a new line to the data. The line consists of a name, one space, and then a 3 digit number. I was wondering if anyone could help me edit …

Member Avatar for Ancient Dragon
0
101
Member Avatar for cmoney12051

I am trying to firgure a way to store test scores to a arr or something so i can sotre 20 different scores and twenty different possible points values. but i cant seem to get it right i have almost everything done acept storeing the vales so i can recall …

Member Avatar for cmoney12051
0
93
Member Avatar for h0neydip

ok i have this program dealing with date Class. im having trouble with the overloaded operator % which returns a date with smallest component month, day, and year for two given dates. your help is very appreciated. For Example: d1 is May 5 , 1942 d2 is August 1, 1970 …

Member Avatar for Ancient Dragon
0
366
Member Avatar for black_adder

hello all im having trouble with entering data in arrays that are in a structure i was given a task to write the code for the following: 1) define structure tstudent that has the following info about students ---index number (int) ---name (char) ---age (int) 2) define structure tgrades that …

Member Avatar for Ancient Dragon
-2
91
Member Avatar for Spagett912

I'm solving a problem and am near completion but am having one little problem. I'm about to show the coding that i have but i need to make name, age, and weight value returning functions as well. You'll see what i mean. [code=cplusplus] int main() { Class secretType { Public …

Member Avatar for Ancient Dragon
0
88
Member Avatar for angleyz14

I need to write a program, that if anyone ever played memory when they were younger does exactly that, that asks a user for 8 numbers. the numbers the user inputs need to be scattered across a 4x4 array. for example if a user enters 4 there need to be …

Member Avatar for vmanes
0
77
Member Avatar for mikky05v

this is simulated data on daily vehicle traffic crossing a bridge for one week. From Monday through Sunday the daily vehicle counts were {986, 818, 638, 763, 992, 534, 683}. Create an input file named cars_data.dat containing these numbers. Write a program that will read these values from the input …

Member Avatar for hammerhead
0
145
Member Avatar for Raptoricus

Hi I have been programming for about 3 weeks now and am really starting to get somewhere with it, but I have encountered a problem with this text rpg that I am making, the problem is I have made 3 header files being 1.character(contains character class) 2. monster(another class file …

Member Avatar for Raptoricus
0
120
Member Avatar for Yellowdog428

for some reason I cannot add integers in an array of structures. here is the code. [CODE=c++]#include<iostream> #include<iomanip> using namespace std; const int SIZE = 5; struct playerInfo { char name[30]; //Players name int number; int points; }; int main() { int total = 0; // to hold total points …

Member Avatar for Ancient Dragon
0
83
Member Avatar for peachslasher

Hi, I've question regarding visiting and printing nodes for tree traversal. the main purpose of my program is to create tree for an arithmetic expression and then perform in-order and post-order traversal on the tree. The structure tree need to be hard-coded in the program using linked-list/pointer stored in one …

Member Avatar for Salem
0
147
Member Avatar for ra_rodri

hello all i wrote the a dll using vb 6.0 this dll only has this function: Public Function Impresion(ByVal Nombre As String) Printer.Orientation = vbPRORLandscape Printer.ScaleMode = vbInches Printer.Font = "Arial" Printer.CurrentX = 0.5 Printer.CurrentY = 1 Printer.Print Nombre MsgBox Nombre Printer.EndDoc DoEvents End Function the dlll works fine when …

0
67
Member Avatar for username99
Member Avatar for only me

hello everybody I need your help please I have Q for u write C++ code to display all emrip numbers between 2 and 1000 and returns their count to the program

Member Avatar for Salem
0
97
Member Avatar for picass0

i have a text file that has delimiter. i wanted to display the test file that will take away the deliminter from my text file. i search through the net was told to use getline() which can include the deliminter. Hope that is someone who can show me an example …

Member Avatar for Nick Evan
0
91
Member Avatar for Heli

Hello, I've been Google'ing(?) like crazy for the last hour or so trying to find an answer to my problem, however the problem is simply that I'm not too sure [i]what[/i] to search for :S My basic problem is that I want to change the default way in which the …

Member Avatar for Nick Evan
0
156
Member Avatar for dpfaff

I am taking a introduction to C++ programming class in college and I am having some issues with my assignment. If anyone can help It would mean a world of diffrence to me. Thanks in advance. Okay the assigenment is to write a program that simulates the lottery, the program …

Member Avatar for Ancient Dragon
0
267
Member Avatar for nurulshidanoni

Can anybody help me whis this error? in red colour... error C2109: subscript requires array or pointer type error C2109: subscript requires array or pointer type : error C2109: subscript requires array or pointer type error C2664: 'void __cdecl std::swap(int &,int &)' : cannot convert parameter 1 from 'int' to …

Member Avatar for Agni
0
942
Member Avatar for kalodakilla

my final assignment is about making a program like a TinyGoogle.. But actually, i'm just a Freshman and it's kinda hard to have all the knowledge to make these all through.. Hope u guys can help, thanks a lot [URL="http://kalodakilla.googlepages.com/CS162-Final-Project-TinyGoogle.pdf"]http://kalodakilla.googlepages.com/CS162-Final-Project-TinyGoogle.pdf[/URL] The first problem is that i dont understand what does …

Member Avatar for dougy83
0
91
Member Avatar for littlestone

For a singleton class, there is only one instance in a process, so it's not necessary to define a member function as static, am I right? Thanks in advance.

Member Avatar for dougy83
0
231
Member Avatar for allialli

[B]hi. can anyone please help me with this assignment?[/B] Write a function called divideMe which takes two integer parameters x and y and returns a double which is the division of these numbers (x / y). If y is zero, print the message "Divisor can not be zero!" and return …

Member Avatar for allialli
0
318
Member Avatar for Ryano24

I wrote this code to re-create the classic race of the tortoise and the hare and everything compiles fine. Just the logic is messed up. When I run the program all I see is BANG AND THEY'RE OFF and who wins. I should be seeing a T for the Tortoise …

Member Avatar for vmanes
0
1K
Member Avatar for sohamghosh

My code for address book is as follows: [code=cplusplus] #include <iostream> #include <cstring> using namespace std; struct { char name[101][30]; char telephone[101][8]; char email[101][20]; char address[101][50]; char postal[101][6]; }employee; void enter() { int n; cout << "Number of entries?\n"; cin >> n; for (int i=0; i<n; i++){ gets_s (employee.name[i]); gets( …

Member Avatar for sohamghosh
0
95

The End.