Beginners - January 2018 (Page 13)

basic string operation issue
 
This few lines of code are supposed to extract integers from "it" to "s1", until a '/' is found, however i get a subscript range error, what did i screw up? ...
[3 replies] Last: Good to hear, although I do still encourage the use of the std::string... (by Ganado)
by wtbe
Student grade sort program
 
Write your question here. /* This Program takes the average of a user's test after dropping the lowest test score. You can enter as many scores as...
[5 replies] Last: When I fix the problems with getScore(), the code works for me. I sug... (by dhayden)
by al8888
cant return float value
 
why does it not return the float value and return true or false instead. #include<iostream> using namespace std; float myFunc(float); float theP...
[4 replies] Last: Hi al8888, in addition, you also must return a value here, or otherwis... (by Ganado)
by sevic
Finding index of custom element in vector
 
Hi I have a vector of objects of class Person(id,name) and i wanna know is there a way to find a person index in vector by its id and name? Is there a way to...
[2 replies] Last: You may use find_if. See: http://www.cplusplus.com/reference/algorith... (by coder777)
by mmgh
abstract base classes and derived classes
 
Hello, If I define an abstract base class with for example 10 virtual methods, then do I have to define all the virtual methods in any other class I derive f...
[1 reply] : > If I define an abstract base class with for example 10 virtual metho... (by JLBorges)
Need help with an exercise
 
Can someone please explain how this code could work? I can't find a way to approach this problem. Given n names and phone numbers, assemble a phone book ...
[1 reply] : For how map works see this: http://www.cplusplus.com/reference/map/ma... (by coder777)
how to use find algorithm in C++ with Objects
 
how do i use the find algorithm to check if a certain object exists in a vector. I have a base class called Shape and derived classes Circle and Line. Circle...
[7 replies] Last: -> bool determines the return value. It can usually be automatically... (by coder777)
Student Grades Using File I/O and Arrays
 
I'm required to input the student id, exercises, total of the ten assignments, midterm, the final, and extra credit points. Combined, the assignments are all ou...
[1 reply] : > Here's the source code and output file ¿where's the input file? ¿h... (by ne555)
Help!
 
What does this code do line by line and is there a problem with this code? int main (){ vector<int> v( 5, 1 ); for( int i = 0; i < 5; i++ ) { v =i ; ...
[1 reply] : Have you tried to run it ? (by SamuelAdams)
by Carat1
cheat engine to c++ help
 
i need someone with cheat engine knowledge. i need help memory scanning for a pointer. the code below scans for an address. scanner::find_pattern(0x0000000...
[2 replies] Last: Numbers (and pointers) in the x86 are stored in "little endian" format... (by dhayden)
Give references values?
 
Why is this possible?: #include <iostream> using namespace std; int main(){ const int &a = 10; //<- this return 0; } I thought I understood references...
[1 reply] : Well, the short answer is that you can do that because the standard sa... (by Ganado)
by jojfjo
Exponents in formulas
 
Hello doing a project for school and little confused by my error. this is my formula; so I have all my values declared as doubles. And then after declaring...
[2 replies] Last: i figured not to use cmath because it was not shown or spoken of at an... (by jojfjo)
array of characters: it doesn't print the exact size!
 
in this code, the output is 6 instead of 5, i didn't get it! the condition is to not include '\0', is the compiler counting it ? #include <iostream> usi...
[4 replies] Last: ...and to clarify further, you're thinking of string literals. They wi... (by Ganado)
by Jsmo10
My output doesn't match locals
 
Hello all! I need help with my findHigest and findLowest. In the locale it is listing the right numbers but I can't get the output to match what the locale has....
[1 reply] : > cout << "The Best Player is Player Number: " << findHighest << endl... (by ne555)
code giving wrong output after comparing against file
 
Why will my code only output that the password has no match in the file even when it does match a password in the file? The whole program is way longer than thi...
[4 replies] Last: Thanks for helping me with this question. (by hornet13)
SDL2 tutorial, guides?
 
I have been playing around with C++ for a while now but wish to get started with game development in SDL2. I've watched several videos on YouTube but none seem ...
[2 replies] Last: Thanks! I'll look in to it.😃 (by Sigge414)
by ZekDe
I couldn't think a good title for this.Simple question
 
Hello friends, I am not able to understand this,could you help me.I am using Qt creature //This is in .h class MainWindow : public QMainWindow { ...
[4 replies] Last: I am new communication engineer ,this is why I don't know perfectly C+... (by ZekDe)
list
 
Why do program crash sometimes? *update* without "delete" is working fine! #include <iostream> using namespace std; struct lista { int n; li...
[2 replies] Last: Thank you (by alanmonno)
by al8888
floating point exception(core dumped) and can't return -1
 
In my book the question is "Write a function that takes two unsigned short integers and returns the result of dividing the 1st argument by the second. Do not pe...
[5 replies] Last: thanks I think what the teacher wanted was: #include<iostream> using... (by al8888)
by sevic
Saving data at runtie
 
Hi, is there a way that is considered best to save data at runtime in C++ program? For example, we want to sort a vector of integers and during sorting, we want...
[1 reply] : If you mean within the same program run (i.e. not after the program en... (by Repeater)
January 2018 Pages: 1... 1112131415... 22
  Archived months: [dec2017] [feb2018]

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