Beginners - March 2016 (Page 39)

How do I make this into a class function?
 
I don't understand functions very well and my professor hasn't been any help. My code works perfectly for the purpose and logic. However, I don't have the corre...
[2 replies] Last: Ok, Write it like this: #include <iostream> #include <string> #inc... (by theturk1234)
How Do I Pass Two Objects to be Stored in Another object by reference?
 
I have classes A, B and C stored inside an object, X. I want to pass class A and B by reference to class C because class C needs to use some functions inside cl...
[2 replies] Last: Hi, I am guessing you meant C needs to use functions in A and B. Can... (by TheIdeasMan)
reading files that contain both string and int
 
txt. file contains human#dog#24 cow#fish#64 how do i turn the .txt file into an array/2d array but also removing the #.
[2 replies] Last: You can use std::getline() whose last parameter is a delimiter which... (by KMagic)
by cyter
How do I pass arguments to functions with makecontext?
 
I would like to pass arguments to functions that get context switched into but I'm having problems... #include <ucontext.h> #include <iostream> #include <cstd...
[2 replies] Last: Line 50, 58 and 66.38 (by cyter)
project help
 
project says 1. have user input number that is greater then 0 and add them to total 2. exit loop on -99 3. once out of loop calculate tax due on total and calc...
[no replies]
Computing grade sign
 
Writing a program to compute the grade and give a grade sign. I got down the compute grade part done, but I'm having problem calculating a sign using switch. A...
[1 reply] : why not trying to use series of If statements as follows: if (point>... (by Aminu Bishir)
Classes
 
I'm writing a program to be able to accept information from a "customer" (program user) and then store it all before showing the customer what products our stor...
[3 replies] Last: Hey so does this not ask the customer for their first and last name? i... (by Sparrow17)
having trouble finishing my stack
 
I need to build a dynamic stack and am struggling to get it to work here is the pseudo code Constructor: UnboundedStackImplementation () 1. Initialize count...
[6 replies] Last: template<typename T> class node { private: node<T>* next; T data;... (by Trigguy)
How do I erase the first 7 rows plus the 9th in a 3d vector like vector<vector<pair<int,int> > >?
 
Thing is that I have tried with memcpy, assign, copy_n, and copy, to no avail in the last two weeks by now. If you have an idea please use my code above to show...
[2 replies] Last: Thank you cire for your quick answer.I did what you proposed and manip... (by Bo Nystedt)
Dice Game.
 
Hey guys, I'm trying to make a console dice game, but I've got some problems. #include "stdafx.h" #include <iostream> #include <string> #include <algorithm> ...
[4 replies] Last: Thanks so much! :) (by Idiotal)
by WhatIf
ifstream object seems to be null
 
I'm trying to open a file and read its content but it seems that the ifstream object is null DatabaseReader::DatabaseReader() { std::string complet...
[3 replies] Last: I moved std::ifstream DBFile; outside the constructor, before the co... (by WhatIf)
Help rearranging motion equations
 
Hey guys and gals, been a while since my last post. First of all let me explain what I am trying to achieve: Threaded simulation I have created a little 1...
[5 replies] Last: Thanks for the help with the mathematics parts guys I appreciate it. I... (by megatron 0)
Template functions populate_array, display_array, etc?
 
Hello. I have to write a program that uses the following template functions: populate_array(), display_array(), invert_array(), sum_array(), max_element(), a...
[7 replies] Last: //does not work std::reverse(std::begin(arr), std::end(arr)); ... (by TheIdeasMan)
Can you please tell me what did i do wrong.
 
Hello, can you guys please help me with my code, i am new to function, vector, passing data to array from vector and stuff. So, can you look through my code and...
[3 replies] Last: Tnx man, will keep this in mind! Appreciate good tips about my code! (by etrusks)
I have a problem with 'cin >>'
 
I've made my own version of "Lost fortune" but when I put a 'string' instead of a 'value' after 'cin >>' it skips the next 'cin >>' and changes the 'string' in ...
[1 reply] : http://www.cplusplus.com/forum/articles/6046/ (by rafae11)
Is there some error in my code??
 
I just start learning array in c++, and i have a problem. The problem will input some array and i need to output it backwards. ex: input: 1 2 3 4 5 outp...
[2 replies] Last: Thanks it works (by AnantaP)
by BrentY
Random selection of numbers
 
I am trying to have my program randomly select a number from the numbers 4, 5, and 8. These numbers come from the length of 3 strings I have. You can see the co...
[6 replies] Last: @jpp2002, when writing some code for a beginner my primary aim is tha... (by Thomas1965)
by Rawrr
Error Checking
 
Everytime I run my program and enter in a letter for my input values I go into an infinite loop, I have no clue how to error check it either, I've been workin...
[11 replies] Last: @mgoetschius It's alright, you weren't the one teaching it :+D I u... (by TheIdeasMan)
Up for the challenge?
 
I'm supposed to fill a vector by reading a file with a list of President's birthdays. I am to use a class to do this. I gathered what I feel I would need and i'...
[4 replies] Last: my updated code: #include <iostream> #include <fstream> #include <s... (by phatboy)
by phAMG
Subtracting from inventory
 
Deleted, Thanks
[1 reply] : Code is text. Please don't give us images of your text. Also, this i... (by cire)
March 2016 Pages: 1... 3738394041... 47
  Archived months: [feb2016] [apr2016]

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