
please wait
by Angela1998
Object with constructor as member of another object
|
Hello, I'm Angela and I'm new to the forum and the C++ programming language. Suppose I have a class Engine like this: class Engine { public: Engine(/... |
Feb 15, 2019 at 10:14am
[2 replies] Last: I mean, of course it's that simple! hehe thank you sir! :) (by Angela1998)
|
by jbennett
columns and rows
|
I am trying to figure out how I would store the values for the total cols and rows so my print_array function would output them. I am having issues understandin... |
Feb 15, 2019 at 6:15am
[8 replies] Last: In both of your totalling routines you have declared i, j to be double... (by lastchance)
|
by bbsmiley
Find index of an element within the array
|
I have the following function: template <typename T> size_t FixedVector<T>::find(const T& value) { // to be completed size_t index_ = 0; f... |
Feb 15, 2019 at 5:07am
[2 replies] Last: Thank you so much. I did what you told me and it works now. (by bbsmiley)
|
by chocotaco
My code skips the first line
|
When I'm running the code it runs but it skips the first line of entry and I'm not sure why. I've tried looking up for solutions like cin.ignore() but it seems ... |
Feb 15, 2019 at 3:27am
[5 replies] Last: Thanks guys this is helping me learn. (by chocotaco)
|
by Zivojin
Extend dynamic array of pointers
|
Let's say we have class Example.With a constructor we initialize n pointers,but later in the program if we just want to extend that array,what is the best thing... |
Feb 14, 2019 at 11:40pm
[4 replies] Last: Thanks for your advises.We must use dynamic memory allocation this way... (by Zivojin)
|
by Cairus
Object and Class Issues
|
In this code I got age to work, but I think im misunderstanding HOW it works as I am trying to get it to also do weight but am running into a bunch of different... |
Feb 14, 2019 at 11:29pm
[2 replies] Last: It is a very good thing to learn to debug because as you improve your ... (by Zivojin)
|
by Maria2
C++ more then one max values (1,2)
|
Is there any C++ function that returns the highest value s in an (int) vector, e.i. {4, 0, 2, 4}? Hope there is a function that can return: "The highest val... |
Feb 14, 2019 at 10:42pm
[25 replies] Last: f = count(vs.at(i).begin(), vs.at(i).end(), alpha ); alpha is the s... (by Maria2)
|
by NKGold
I cant find the error
|
After I wrote this program I got a a lot of error messages but I cant find where I went wrong. #include <iostream> #include <string> #include <cstring> ... |
Feb 14, 2019 at 10:13pm
[4 replies] Last: Thanks, that worked (by NKGold)
|
search word in file: i get different output like i want (1,2) |
hello everyone, i know this is very messy but i have a problem searching a word. i want to search my text file user input : part output should only be "part" ... |
Feb 14, 2019 at 9:19pm
[20 replies] Last: You cna make some function that comapes two words letter by letter and... (by Zivojin)
|
Reading in string and passing data to an array |
I have a text file filled with decimals and I am trying to pass that data from the text file into an array. I have succeeded with reading in the data from the t... |
Feb 14, 2019 at 9:12pm
[5 replies] Last: #include <iostream> #include <fstream> // accept all streams, not ju... (by keskiverto)
|
by FreeThinker
My Min and Max Values are displaying as '0.'
|
Hello, I am currently working on a project that requires the maximum and minimum of four randomly entered numbers to be outputted. I seem to be on the right tra... |
Feb 14, 2019 at 6:53pm
[4 replies] Last: I appreciate your help guys! (by FreeThinker)
|
by ayush892
I can't run this program with values >5
|
#include<iostream> using namespace std; int c,d; int func(int a,int b){ if (b==0){ c=1; } else{ while(d<=b) c=c*a; a++; ... |
Feb 14, 2019 at 6:50pm
[3 replies] Last: A value of 6 will cause you to enter your while loop, which leads to a... (by Ganado)
|
by ramp00
Struggling to cout vector when using classes
|
I'm currently trying to make a blackjack game, and I try to cout different values to check if I'm on the right path. I'm new to classes, and I don't really unde... |
Feb 14, 2019 at 6:16pm
[4 replies] Last: That cleared things up a bit. Thanks! (by ramp00)
|
Using a while loop to write to a file |
Is it possible to use a while loop to continuously write lines to a file and quit when you're finished? Or do you have to use a for loop? #include <iostre... |
Feb 14, 2019 at 6:16pm
[17 replies] Last: Thank you for the explanation. I believe I understand now. I just crea... (by nicholasjb1996)
|
by Brendon130
Previous exam question
|
Hey guys, This is an exam question that was on a previous exam for my programming class a few years ago made public for us to practice. Could anybody help m... |
Feb 14, 2019 at 5:37pm
[4 replies] Last: If you don't have the rest of it, I would find a better problem to wor... (by jonnin)
|
Error C2360 |
Keep getting error C2360 and C2361, it basically skips ''nummer''. #include <iostream> #include <iomanip> #include <string> using namespace std; std:... |
Feb 14, 2019 at 4:18pm
[4 replies] Last: Hello Normal student, PLEASE ALWAYS USE CODE TAGS (the <> formattin... (by Handy Andy)
|
by Chris26
equal bool help
|
Hello together, i use this if(equal(nochmal, "Ja")) but how can i use this so it is NOT EQUAl nochmal "ja" ? Thanks in advance |
Feb 14, 2019 at 4:16pm
[2 replies] Last: if equal() is a user-defined function, if(!equal(nochmal, "Ja")) { } ... (by Grime)
|
Sorting array |
Hey I dont know what is wrong with my code. It can run but doesnt do what I want it to do, which is sorting values of array from small to large number. It just ... |
Feb 14, 2019 at 3:42pm
[2 replies] Last: hey thanks Jlborges (by thejogger1998)
|
eliminate the character |
Hello, does anyone know how to eliminate the character? left only number and words #include <iostream> #include <sstream> #include <fstream> #include... |
Feb 14, 2019 at 2:42pm
[8 replies] Last: bool remover(char c) { return (c=='.' || c=='\'' || c == '\"'); }... (by jonnin)
|
by Chris26
String accept both upper and lowercase?
|
Hello guys, i have 2 question 1st: Is it possible to accept both upper and lowercase? For example you have this code string question; cout... |
Feb 14, 2019 at 2:12pm
[12 replies] Last: it seems likely mine was using the C version, actually... looking at ... (by jonnin)
|