
please wait
I get a different answer to the correct answer when I run my code, my logic seems correct. not sure why? |
I'm doing a series of excercises to get a better understanding of functions for college. I'm currently doing one now where "A function NumDays that may be pass... |
Feb 5, 2017 at 8:17pm
[3 replies] Last: @joe864863 @jonnin That was a mistake by me in the question joe, I'm t... (by willmannix123)
|
by Kourosh23
Factorial of a number in C++
|
Personal contribution to open source C++. #include <iostream> using namespace std; // Program to find the factorial of a given number. void factorial (long... |
Feb 5, 2017 at 8:14pm
[5 replies] Last: @jonnin: Why inline your function? It's also a good idea to mark your... (by mbozzi)
|
by Brendy1982
C++ Code not running properly and need some advice for my project! :)
|
Hello everyone. I'm a beginner, and need help with some code that wouldn't work when i ran it. Though when use the "run line by line" thing it works just fine. ... |
Feb 5, 2017 at 8:11pm
[1 reply] : use the same function in main, you don't need 4 copies of it, that is ... (by jonnin)
|
by Kourosh23
prefix and post-fix using decrement operator C++
|
Personal contribution. #include <iostream> using namespace std; // Program to explain prefix and post-fix using decrementation. void functionOne (){ int a... |
Feb 5, 2017 at 7:42pm
[no replies]
|
by wolfv
How to capture cerr from another program?
|
I wrote an application in C++ that throws exceptions, and catch sends error messages to cerr. Now I am writing a tester in C++ that calls the application. The t... |
Feb 5, 2017 at 5:59pm
[5 replies] Last: I went with the example from JLBorges because it's so simple. The foll... (by wolfv)
|
by forta2k
Divisors
|
I have to write a program which displays how many divisors containing the digit "3" does the number entered have. When I introduce a number, nothing happens. ... |
Feb 5, 2017 at 5:36pm
[4 replies] Last: Just playing with it... alternative approach char dtxt ; char * has3... (by jonnin)
|
by redhood
Tips when tracing codes in an exam?
|
hey guys, im having a pretty hard time tracing codes in exams/quizzes and i was wondering if you guys could give me tips on how to trace and can anyone give me ... |
Feb 5, 2017 at 4:58pm
[1 reply] : I do not know of a site, but this is a critical skill to debugging. ... (by jonnin)
|
by steven77
using a class inside another class
|
Probably a noob mistake, but I do not find why my compiler gives me the following error : error: ‘sleep’ does not name a type in this code : #... |
Feb 5, 2017 at 4:12pm
[1 reply] : Looks like you have a name clash with the POSIX sleep function. http:... (by Peter87)
|
by redhood
Help with my homework
|
Hi there! I'm a beginner programming student and i was given this homework yesterday. im very confused and having a hard time making it run properly can you guy... |
Feb 5, 2017 at 3:44pm
[5 replies] Last: hey thanks alot man, sorry i only got to replied now. i totally forgot... (by redhood)
|
by nfnicolas
Output list book
|
Hi everybody. I have code which output books. But I can't create database books to output a list. Where I must create this database? I think in class Book? But ... |
Feb 5, 2017 at 2:07pm
[2 replies] Last: Yes I know. I was trying to create, but do not know how to connect thi... (by nfnicolas)
|
by Nalrie
Guess my number
|
I got really confuse on putting in arguments for the getUserResponseToGuess() function. I don't really know what to put into that argument. I wanted the user to... |
Feb 5, 2017 at 10:53am
[1 reply] : I am not sure, but maybe you should be thinking about random numbers b... (by Kourosh23)
|
by spax1111111
initialising a pointer with a function address
|
How to create a pointer to void function? int sq(int num) { return num*num; } int kub(int num) { return num*num*num; } void central(int num, int(*p)(int)... |
Feb 5, 2017 at 9:54am
[8 replies] Last: Thx guys this helped a lot i get it now :D (by spax1111111)
|
by sesslit805
transfering inputFile to vector c++
|
We're supposed to Write a program that reads an unknown number of integers from a data file called “data.txt” into a vector of integers named V. V is initia... |
Feb 5, 2017 at 7:44am
[2 replies] Last: Thanks it worked ! (by sesslit805)
|
by Zerdalias
Returning value with template function?
|
I'm not sure if the title makes sense, however, this code was working when i had the function returning the index number of the highest value. When i then chang... |
Feb 5, 2017 at 6:19am
[6 replies] Last: Oh! Awesome, I get it now! Thank you! (by Zerdalias)
|
by rantiv
Single If statement
|
I have to turn in my code and just realized one of the requirements is to have just one single if statement. I have a lot of nested if statements and cant figur... |
Feb 5, 2017 at 5:56am
[7 replies] Last: Once you see it, it's dead simple: The first thing I would do is corr... (by mbozzi)
|
by sandoda
Hybrid Car
|
It is supposed to look like this but for some reason when I enter (total) my code just stops. Im not really sure what I am doing wrong. I know this is a big que... |
Feb 5, 2017 at 5:44am
[1 reply] : @sandoda You're program worked fine for me. I used all the inputs you... (by whitenite1)
|
by Flaze07
stoi
|
hey, just some question, what if stoi has an error ? does it return boolean like sstream ? because I failed at using stoi for something I succeed with sstream... |
Feb 5, 2017 at 5:12am
[2 replies] Last: thanks :) (by Flaze07)
|
by tunalafish
Im not sure on how to pass an array through reference without using pointers.
|
Hi I need help in learning how to pass an array without using pointers and this is a homework assignment. I already have the first part of this hw assignment do... |
Feb 5, 2017 at 5:07am
[1 reply] : #include <iostream> const int arraySize = 5; int main() { int ... (by gunnerfunner)
|
by HRubss
y always equals 1?
|
So it's my 3rd day of programming class and I'm having troubles with my program assignment. The assignment is listed in the comment. Everything ran fine when I ... |
Feb 5, 2017 at 4:57am
[5 replies] Last: /*write a program that asks the user to enter an integer x. Based on... (by HRubss)
|
by Kourosh23
constant argument to a function
|
Personal Contribution to open source C++. Note: The purpose of adding const to your type and variable inside your argument is to catch errors if the user a... |
Feb 5, 2017 at 4:29am
[5 replies] Last: Yes. Ideally, limit the const qualifier to the implementation; at bes... (by mbozzi)
|