General C++ Programming - November 2016 (Page 16)

Sorting a linked list
 
Here is my linked list class. I cannot figure how to sort through the list. Please take a look at my sort function and point me in the right direction. //...
[2 replies] Last: @starFish2 that's a very good idea actually but I figured it out. ba... (by plsalinas)
need help with this question
 
double fun(double *x); // code given somewhere else void main () { double a [ ] {3.0, 1.0, 4.0, 1.0, 5.0}; double b = fun (a); . . . a) I...
[4 replies] Last: b) What piece of information does the code in "fun" have to obtain fr... (by closed account 1vRz3TCk)
Utilizing a file created from a function.
 
Hey guys so this is my function: string testGet() { string File1 = ""; string File2; ifstream inFile; ofstream ouFile; cout << "Name of file blah: "; ...
[3 replies] Last: Thanks a bunch Peter!! I swear the simplest of mistakes in c++ give ... (by Simbaku)
sorting string in my file
 
hey guys hi, I want to sort my items using Array, would anyone help me out please. #include <iostream> #include <iomanip> #include <fstream> #include <limits...
[1 reply] : Can you show us the contents of the file "AAAAAA.txt"? (by starFish2)
C++ std namespace
 
So everything in the standard C++ library is in the std namespace right? Like std::cout, std::cin, etc. Also the C libraries like stdio.h are in C++ like cstdio...
[11 replies] Last: [quote=boost lexical cast] getline(file, str); // in the arguments the... (by Peter87)
Map to store templated base class.
 
For my project I have created a templated base class that allows me to store char, int or doubles and from it I can create derived classes that do what I expect...
[10 replies] Last: "//to be implemented after Data" => because the Data_base methods nee... (by gunnerfunner)
Parallel Arrays CandidateVotes Please help
 
So im doing this Candidate Vote in which the name and the vote are gathered from a file.txt and then shows the percentage of each candidate and then display the...
[4 replies] Last: #include<iostream> #include<fstream> #include<iomanip> #include<strin... (by closed account 48T7M4Gy)
by te777
Need to make code faster
 
I'm trying to solve the Hackerrank challenge of Super Functional Strings. My code passes through test 4 then times out. All the tests need to run in <= 2 second...
[1 reply] : long cum ; What does the word "cum" mean? You have a working p... (by cuteApple)
Percentage formula not acting correctly
 
#include <iostream> #include <iomanip> using namespace std; int main() { int total_floors, floor, rooms = 0, occupied = 0, unoccupied, percentage; cout <...
[4 replies] Last: Hmmm... well gives different results for me. Using GNU g++ -std=c++14... (by boost lexical cast)
Compilation question with exception handling
 
Today in class, the teacher was talking about exception handling. I'm a Linux user so I use the g++ compiler. But I also have Virtual Studios installed on a Vi...
[1 reply] : The type of the literal string "Error: divide by zero atempted" is '... (by JLBorges)
Mirroring a Vector of Vectors
 
Hi all. I've been tasked with reading and modifying a PPM file. The problem I've run into is being able to flip the image across the y-axis. An example vector w...
[5 replies] Last: Flipping the image across the y-axis is just reversing the positions o... (by JLBorges)
Text Based Graphics Library (Non Console)
 
I have worked with console based ASCII graphics systems and made one too. I have also worked with normal 2D graphics of course. I am hoping to make a text based...
[no replies]
function/array
 
Please help. I posted in beginner as well, but not a lot of response so thought I'd see if I'd get a nibble here. I'm constructing a program that reads in from ...
[17 replies] Last: i got it!!!!!!!!!!!!!!!!! of course a day too late...but i got it! wel... (by NavyVetSafIn)
switching names from first name last name to last name first name.
 
i have a program that reads in from a txt file. called names.txt. the file has a main and a .h file while is where the functions are written. how do i switch at...
[3 replies] Last: i updated that read file this is what i got for that so far but I'm no... (by cody1998)
Display the vowel characters
 
Write, Compile and Execute a C++ program that enters a string from the user (a full stop ‘.’ indicates the end of the input string) and finds and displays...
[2 replies] Last: Do you know how to start the program? (by tandoro)
Counting Characters
 
Can someone please help me with this You are given several lines input data, each line containing exactly 25 alphabetic characters, A through J, only. The c...
[1 reply] : Please use code tags. http://www.cplusplus.com/articles/jEywvCM9/ ... (by integralfx)
How can I find out what went wrong opening a file with ofstream?
 
Hi, I have the following code and need to know why it isn't creating the file: ofstream out{ outputFileName, ios_base::trunc }; if (!out) { o...
[7 replies] Last: So? Am I missing something? I know my code is trying to create a file... (by cire)
by bozmin
Undefined symbols for architecture x86_64
 
I am always getting this error without understand what the hell it mean . I ve been getting it since i started using c++ object oriented. can anybody explai...
[3 replies] Last: Check for typographical errors in the definition's signature. Check t... (by mbozzi)
Address Book
 
So I am not really good at object programming can someone show me how this assignment should be put together in code? Thanks LinAppleSoft has asked you to cr...
[1 reply] : Here's a starter. Good Luck! class SchoolContacts { protected: strin... (by rghrist23)
Vector defined static
 
I dont have any ideea which vector defined static can i use for this class, and i dont know how to define it. Can you help me ? Thanks ! class User { priv...
[1 reply] : #include <iostream> #include <vector> using namespace std; class U... (by gunnerfunner)
November 2016 Pages: 1... 1415161718... 23
  Archived months: [oct2016] [dec2016]

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