Beginners - February 2017 (Page 21)

Why am I getting error LINK2019 and LINK1120?
 
Every time I try to run this code I get those two errors. I don't see any missing semi-colons or anything? There are no other errors besides those two so I don'...
[4 replies] Last: cire, Thanks. I missed that when I was checking. Thanks again, Mist... (by MisterTams)
Reading Input File
 
I am to read in a road map of interconnected cities and their corresponding distances as part of an assignment. The file has format like 'source city, destinati...
[4 replies] Last: http://www.cplusplus.com/forum/beginner/208396/#msg981999 (by closed account 48T7M4Gy)
Read Source/Destination City Pairs from File
 
In a sample .txt file to be read in for a uniform cost search program, the first city in a line is the source, followed by the destination city, and finally the...
[3 replies] Last: http://www.cplusplus.com/forum/beginner/208328/#msg981854 (by closed account 48T7M4Gy)
Iteration: for loops
 
I can seem to figure this question out, can someone please help me out? Thank you in advance! Given an int variable n that has already been declared and ...
[3 replies] Last: http://www.cplusplus.com/doc/tutorial/control/ (by ar2007)
Is there an easier way to instantiate many objects?
 
My teacher once told me if I am using a lot of repetitive code chances are I'm doing something wrong or inefficiently. What I'm trying to do is create a deck of...
[no replies]
by juskar
Print 3D Array Horizontally
 
Hey guys. I have been sitting here trying to figure out how to print this 3D array out horizontally instead of vertically but I am stuck. I've used this website...
[5 replies] Last: BTW I realized I was very redundant and shortened the code. NO - t... (by lastchance)
output problem
 
i can't see any output why??? #include<iostream> #include<string> using namespace std; int find(int a ); int main() { int t=0,len=0,temp ={0} ,k=...
[6 replies] Last: Hi, melinda345. Could you please help me to understand what you are tr... (by Enoizat)
Remember account
 
I am just working so that I can learn by my self. At the moment I am making a blackjack game and I thought it would be cool if I made a user log in that remembe...
[1 reply] : Have you looked into how to read/write a file? Look into using ifstrea... (by newbieg)
Sum of digits in a string
 
This is an exercise for my Intro to CS class (not homework) that I am doing on my own. It asks to write a function "SumDigits", that takes a string as input and...
[8 replies] Last: #include <string> #include <algorithm> #include <numeric> // invaria... (by JLBorges)
Sort words lexicographically
 
So the input is a sentence from the console and using only iostream you should cout every word in a new line starting from the first in the lexicographic order,...
[no replies]
A bug I cannot fix. Input value differs from output value. Please help!
 
Hey. I'm trying to answer a test practice question and I am not able to find a fix to a bug for hours now. I enter 16 values into the program but the first row ...
[4 replies] Last: [quote=Ripper53] And I used count += 1 out of habit. I see...... (by Flaze07)
Find same Words
 
I have some problem with my Code.In my code , i want my program can read the file .txt and i finish with that,but for ouput i want can calculates and displays...
[1 reply] : Use std::map to map each word to the number of times that it occurs ht... (by dhayden)
char and pointers
 
This is probably really simple, and I just can't see it, but can someone explain why the code works... Basically why the -2 // // main.cpp // pointers //...
[6 replies] Last: right! (by jonnin)
by VX0726
Text File Parsing
 
Hello all, As I was running my code, I ran into a certain problem. My function for searching for a range of scores or prices doesn't work. I've spent a few h...
[18 replies] Last: check to see that score is populated with the values you expect. Sort... (by jonnin)
Please explain this program.
 
# include <iostream.h> # include <conio.h> class distance { int feet,inches; public : void distance_assign(int f, int i) { feet = f; inches = i; ...
[2 replies] Last: Dear Keskiverto Kindly explain two questions only.. (by r 4 raja)
Area and volume of rectangle using classes C++
 
Bug! Guys, programming is 90% debugging, and 10% writing bugs, I have been debugging this code for nearly 3 hours. I have a question down below after the cod...
[3 replies] Last: other use; use.set_width( 5.0 ); use.set_length( 10.0 ); double save_... (by keskiverto)
How to extract pairs from a collection of vectors?
 
Hi all! I am stuck with the following problem. I have a map m from int to vector<int>, i.e. suppose we have map<int, vector<int> > m. I want to write a functio...
[3 replies] Last: I have only one question: since I am new to C++ and don't yet have s... (by integralfx)
by mitty
function called from class::member fucntion
 
How can I call variable function from array? food and drink are inside the class Food::food(...) int num =0; const int CAP=10; Food *foods ; foods =...
[5 replies] Last: I want to put array to two variable [food and drink] and array to ... (by integralfx)
String Subscript Out of Range Error... Please help me
 
i wrote a bool function to check if inputted command is in a valid format command is valid if (two alphabets: airlinecode)(digits 0 to 999:flight number)(+ or -...
[5 replies] Last: ...and another, I'm afraid... after if( (plusminus=s.find_first_of("+... (by Enoizat)
if statements execute all outputs and not just one
 
help. my program displays all "if" outputs and not just one. I can't find answers on web either. #include <iostream> using namespace std; int main() { d...
[1 reply] : Assignment operator: = Equality comparison: == ... (by keskiverto)
February 2017 Pages: 1... 1920212223... 37
  Archived months: [jan2017] [mar2017]

This is an archived page. To post a new message, go to the current page.