
please wait
by Mystnight
Help with files and counter
|
This code is suppose to read a file with student ids and their test scores which then gets an average and put all the information in another file. The problem i... |
Sep 30, 2018 at 10:10pm
[1 reply] : Let's look at this snippet: void readscore (int &id, int &test, int &... (by jlb)
|
by Lyrix
Which one cause std::bad_alloc
|
Thx class Solution { public: vector<string> solution; vector<string> findItinerary(vector<pair<string, string>> tickets) { ... |
Sep 30, 2018 at 3:57pm
[1 reply] : The scope of solution is incorrect. Your bad_alloc can happen in s... (by kbw)
|
by diego315
problem with a cubic function code
|
I am a beginner with c++ and am experimenting with functions. I am trying to create a code that gives you the zero(s) of a cubic functions when you enter the a,... |
Sep 30, 2018 at 3:52pm
[6 replies] Last: You can find the full method here: https://imgur.com/a/kX2mno3 Coded,... (by lastchance)
|
by Thomas1965
SIGSEGV on codechef
|
I submitted this code for this challenge https://www.codechef.com/problems/CHEFCHR and got a SIGSEGV fault though the code works fine on my VS 2017 - though I d... |
Sep 30, 2018 at 12:21pm
[3 replies] Last: @Peter87, @keskiverto, thanks it's working now. I even got 100% :) He... (by Thomas1965)
|
Constructors |
In c++ if I define a class to have a default constructor as well as a parameter based constructor but in the main I only instantiate an instance of the class us... |
Sep 30, 2018 at 9:55am
[2 replies] Last: Look at the C++14 tab in http://www.cplusplus.com/reference/vector/vec... (by keskiverto)
|
Pass data of pointer to pointer |
Hi, I am creating a function that will take a void * and pass its value to another void * Here is code: bool test(void* datatoadd, unsigned long long siz... |
Sep 30, 2018 at 9:55am
[3 replies] Last: You should work out why you're trying to write over memory that doesn'... (by Repeater)
|
by ram000
A simple question about why it always tells me character constant is too long
|
here is my code... #include <iostream> #include <string> using namespace std; int main() { int x; cout << "welcome"; cout << " code please?"... |
Sep 30, 2018 at 4:54am
[3 replies] Last: Thanks so much! I learned a lot today. (by ram000)
|
by NCCspartan85
Need Help with my logic error for wind chill factor program.
|
Hello Community, I have an issue with my source code. I believe everything is in order when I do the math on paper it comes out a different result then what I a... |
Sep 30, 2018 at 2:58am
[5 replies] Last: Thanks for that it was another arithmetic issue. Enter a value for F... (by NCCspartan85)
|
How would be resolved this typedef? |
I have here a piece of code from a state machine, extracted from https://www.codeproject.com/Articles/1087619/State-Machine-Design-in-Cplusplus StateMachin... |
Sep 29, 2018 at 5:17pm
[4 replies] Last: First, I thank you for your 'repairing', I fiddled at the code a more ... (by nuderobmonkey)
|
by wolfie16
Class hierarchy
|
I have the following problem. I have an abstract class with a virtual function. < class A{ public: virtual double GetTotalPrice() = 0; }; > A derived... |
Sep 29, 2018 at 1:16pm
[6 replies] Last: > So no need to create these pointers, right? We are creating pointe... (by JLBorges)
|
by Kyoto
Cannot convert 'char(*)[20]' to 'char*' in initialization.
|
#include <stdio.h> #include <stdlib.h> #include <ctime> char location = {"south with beaches", "mountains", "city", "country", "suburbs"}; char color ... |
Sep 29, 2018 at 5:21am
[1 reply] : char* Plocation = location[rand()%5]; //try this. I didn't explain la... (by jonnin)
|
by kada17
Converting text from file into operations
|
I am writing a program that simulate an assembly language (MIPS). What it does is read binary strings from a file and then convert those into instructions and t... |
Sep 28, 2018 at 5:34pm
[2 replies] Last: Thank you for the array tip, I think I know what to do now. (by kada17)
|
by primem0ver
pragma once and circular includes
|
I am used to using defines and #if directive to make sure that already included headers are not included again. On my rewrite of a C++ project I haven't worked... |
Sep 28, 2018 at 4:36pm
[8 replies] Last: That doesn't work the way you think. (but it would if you used ifndef... (by poteto)
|
by thechamp1202
Unresolved external errors
|
Hi there. I am trying to do a program for school but am getting 4 unresolved external errors having to do with my function call in the main. Please help for the... |
Sep 28, 2018 at 1:15pm
[2 replies] Last: Got it, I did that for all of my functions and it works now! Thank you... (by thechamp1202)
|
by lastchance
Function pointers to operators
|
Just curious. Question within code. #include <iostream> using namespace std; struct Int{ int x; }; int operator +( Int a, Int b ){ return a.x + b.x; } int ... |
Sep 28, 2018 at 1:00pm
[8 replies] Last: Thanks @coder777. A catch-22 situation indeed. (by lastchance)
|
by Putarda
Freind class function inaccessible because of template
|
So function from class A is not available to class B because B has a template type and A can't recognize which type to be friended. Does anyone know what is the... |
Sep 28, 2018 at 11:41am
[2 replies] Last: Remove <N> template<typename N> friend class B<N>; (by Peter87)
|
Reading Text File with Delimiter. |
So the file contains integers, string, and a delimiter ','. It looks like this in the file 1234, Whitney Frost, 10, 11, 12, 13, 14 There are 10 students and 5... |
Sep 28, 2018 at 11:20am
[3 replies] Last: You do have: int studentIds ; ifstream inputFile; getline( inputFi... (by keskiverto)
|
by Vemund
I need a new challenge
|
Hi, I am a hobby C++ coder and used some years now with Arduino. I want to say goodbye to wires and hardware and only code for the windows platform. I am a ... |
Sep 28, 2018 at 7:11am
[1 reply] : AFAIK plugins for GIMP are written in python. Small practical tools f... (by Thomas1965)
|
by HazelSquare
Need Help
|
been working on this wage calculator for a while and i cannot get it to print the tax and net pay. please someone tell me what ive done wrong. #include <... |
Sep 27, 2018 at 11:34pm
[5 replies] Last: Your tax_rate is 27.0. If your wage has no decimals and hours has no ... (by keskiverto)
|
cout won't work from within function (ambiguos) |
Hello everyone, I am new to this site and decently new to programming. I am working on a school assignment and keep getting the "cout is ambiguous" error whene... |
Sep 27, 2018 at 8:01pm
[1 reply] : We need to see your code to be able to help. Be sure you post the code... (by jlb)
|