Beginners - April 2017 (Page 10)

File output is null
 
So I have a programming assignment from class, I've coded everything how I believe it should be done, the code has no syntax errors, it compiles and runs, yet t...
[5 replies] Last: @ Enoizat This prompted me to reread the chapter on functions. Thank ... (by trisket)
The iterator invalidation rules Problem.
 
can an iterator be valid after insertion in vector ? i tried this code : vector<int> vec1 = { 1,2,3,4,6,56 }; vec1.reserve(20); auto offend = vec1.end();...
[2 replies] Last: Thanks for replying @dhayden. I think it's now clear 😆 (by AhmedEl3agamy)
Save () function
 
Hi there, I have received a piece of code I intend to use in a library but can't understand the following save() function. Class Person { private: ch...
[1 reply] : The first "Save" line declares the save function. That means it tel... (by dhayden)
by sven
rational number
 
hi guys i need your help... i have my own library of rational number and now i want to found Arithmetic average of rational array in int main helm pe plz ))
[no replies]
Why a garbage value is showing at the index (0) after sorting the array in ascending order?
 
#include <iostream> using namespace std; int main(){ int t; cout << "Enter the array size: "; cin >> t; char array ; cout << "\nEnter the values:\n"; ...
[2 replies] Last: Thank you so much (by r13ayan)
Using cin.getline() with files
 
Hello, i'm taking a fundamental c++ course and a part of my newest assignment is asking me to read 100 characters from a file at a time without having any cut o...
[3 replies] Last: To do this from within the program (convenient if you are dead without... (by JLBorges)
Runtime Error Help
 
So, my code is running without any compiler errors. However, when it outputs the results to the screen, I get the error _ctrisvalidheappointer(block). I know th...
[2 replies] Last: UPDATE: I believe that my issue would be that I need to de-allocate t... (by bacardiman)
Program crashing at random points
 
I've been beating myself up over this, it's so frustrating. I'm using SFML but it should matter, anyway. What I'm trying to do is have a vector of enemies...
[1 reply] : It returns vector subscript out of range Since there's no use of t... (by mbozzi)
How to push_back a vector <struct> ?
 
Let's say I have the following code: #include <iostream> #include <vector> using namespace std; struct something { int x; double y; char c; }; ...
[4 replies] Last: I would like to avoid using emplace_back since it was implemented in C... (by Oriol Serrabassa)
Searching arrays that are a class.
 
How would i go about doing a sequential search on an array that is a class? This code is not working. Thanks for your help!!! int removeFromCart(CartItem ...
[1 reply] : A C-style array, such as the one you're using, can't be adjusted for s... (by gunnerfunner)
Instantiating object with function pointer as paramater
 
Basically I have class B, that in the constructor is creating two class A objects. One class A object is being sent a pointer to the function lessThan, and othe...
[1 reply] : First, an outline of the approach below: 1. have a template baseclass... (by gunnerfunner)
Array with 10 objects and trouble with 2 errors
 
Hello everyone, first i apologize for creating multiple threads i will make sure to keep everything on one thread from now on. I an have the program compiling b...
[5 replies] Last: Hi, caltice. Please, have a look at the following code and ask if spec... (by Enoizat)
A pointer with every word from a sentece
 
Hi there, I was trying to make a chat bot, that learns from human and generate a sentece, etc, etc, so the first step is to transform a sentece in a dynamic arr...
[6 replies] Last: I just want to show me, where in my code is a mistake, and how I can c... (by DirtyBlasion)
How to rand produce a c output.
 
Write your question here. #include <iostream> #include <string> using namespace std; char randn(char letters) //random definition { retur...
[2 replies] Last: Awesome thank you so much gunnner! (by aspaceg)
by Boidoh
How to Implement these operator overloading into a class?
 
Hello. I have this code I wrote myself where I overloaded operators to add, subtract, multiply and divide fractions. I want to implement the overloading into a ...
[2 replies] Last: Oh I thought that it would be able to work with fractions. Do you thin... (by Boidoh)
How to feed info from file handling into a struct
 
Hi this is the first time that I've posted on this forum and i am a big beginner at C++ so if my information isn't enough let me know. Basically i need a way to...
[2 replies] Last: It depends where the information is coming from – if its from a file... (by gunnerfunner)
by Dagr
BigInt
 
Hi guys i have found many topics and references about big int and i want to know for what i need it an where i can found full code of it.
[3 replies] Last: https://gmplib.org/ (by mbozzi)
No matching function call to class member
 
Hello to day as the title says i'm getting a "no matching function call to 'ParkedCar::ParkedCar()' error on line 21 col 9 in the ParkingTicket header file and ...
[2 replies] Last: OMG thank you i completely forgot i had commented them out to later ma... (by AnimeByDay)
write line function
 
is there any function that allows writing to specific line? ex. #include <iostream> #include <cstdlib> using namespace std; int main() top: { cout << "word1"...
[1 reply] : Hello Lopus312, Not that you should use a "goto" in your program your... (by Handy Andy)
Shifting array elements
 
I have to write a program that reads 10 values from an input file and stores them in an array. It should ask the user to enter a positive number n and then shi...
[3 replies] Last: Thank you guys it worked (by rockandrollhead)
April 2017 Pages: 1... 89101112... 34
  Archived months: [mar2017] [may2017]

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