General C++ Programming - January 2016 (Page 9)

return pointer type
 
Is there any function/way to return the type of a pointer? ... int value = 5; void *void_ptr = &v...
[7 replies] Last: I am starting to learn that C++ is there for a reason, and some of th... (by TheIdeasMan)
Help! I'm not satisfied with this code fragment.
 
My goal is to read a set of lines from a file and print out the lines containing a "keyword" along w...
[1 reply] : A little wordier than yours, but it avoids a few allocations/copies. K... (by cire)
implementing header file in .cpp file
 
This is my .cpp file: 1 #include "HCTree.hpp" 2 3 using namespace std; 4 5 void HCTree:...
[no replies]
c++ income tax homework
 
Write a program that can be used to calculate the federal tax. The tax is calculated as follows: Fo...
[1 reply] : Do you have a question or are your intentions to waste our time? (by TarikNeaj)
Non Numeric Inputs
 
How should I code my program to recognize inputs that are not numeric. Whenever a user inputs a let...
[1 reply] : http://stackoverflow.com/questions/18728754/checking-input-value-is-an... (by TarikNeaj)
Need help
 
#include <iostream> using namespace std; int main() { short i; i=3; ++i++=++i++; ...
[2 replies] Last: It does not work. It does not even compile because ++i++ is invalid C... (by Cubbi)
by jres
Subset sum problem with negative integers
 
Take a set A with n_A members. The problem is then to find out whether or not a subset of set A can ...
[3 replies] Last: It seems to me that this algorithm will give false negatives even with... (by helios)
destroy foo
 
How do I destroy foo? struct Foo { type value; type FooMember = value; } ... int m...
[2 replies] Last: yep, go it! (by technologist)
by Ozzy69
Help me with program
 
To display the character %, the sequence %% is used, but to display "" as I lay in printf? Because "...
[1 reply] : \" (by Moschops)
by rain
Cant use command line argument as map key
 
Hi. I have problem with my program. If I use numbers["one"] directly then it prints me 1 but when I...
[3 replies] Last: When I used char*, it iterated in order I added items in this map. ... (by Moschops)
dangling pointer
 
Does delete n_ptr delete the memory n_ptr is pointing to? A * n_ptr = new A(); cout<<n_ptr->...
[5 replies] Last: When we do this: delete n_ptr are we decoupling the pointer from t... (by Moschops)
Please help in rectifying the error in C++ code
 
#include<iostream> #include<conio.h> #include<stdio.h> using namespace std; int count=0; struct air...
[1 reply] : You declare your variable res to be of the type airline (a structure t... (by Shadowwolf)
Pi Values Using Leibniz Formula
 
I am still in the learning process of C++, and I have this assignment due Monday. My problem is that...
[3 replies] Last: My suggestion, for what it's worth. Notice how the terms are grouped i... (by Chervil)
conio.h & stdio.h
 
Write a program to read in the user’s name. User can type a maximum of 25 characters including spa...
[1 reply] : #include <iostream> int main() { const std::size_t INPUT_LIMIT =... (by JLBorges)
by k1135
Assignment Help Please
 
Hi I have an assignment, probably easy for a lot of you but im new to this programming and trying to...
[1 reply] : Your location need to be an array. double Loc ; To get get/set th... (by Thomas1965)
by zoda
10 is an odd number
 
When I run this code, I get "The product of 5 and 2 is 10 and is odd. The sum of 5 and 2 is 7 and ...
[2 replies] Last: I assume this is what u wanna do... :) #include<iostream> using nam... (by Frooster)
static_assert does not tell me which type is offending
 
Hi, I am having the following compiler error: static_assert(is_enum<_Tp>::value, "This hash on...
[3 replies] Last: a compiler I don't know if you chose to use such an eccentric operatin... (by ne555)
Help!!! trouble with Array loading and Debugging
 
I'm having some issues with this project I've got a baseline of code but my void is reading as incom...
[9 replies] Last: > Another might be to create a uniquely-named output file from your pr... (by ne555)
Help! input file won't open
 
I can't figure out why my input file won't open. #include <iostream> #include <string> #includ...
[1 reply] : - The file does not exist (different name, different directory) - You ... (by ne555)
SFML storing drawables?
 
Hello! I'd like to make games in future, so I started learning SFML. In sfml there are classes fo...
[9 replies] Last: Ok, thanks I'll go with what Moschops suggested, probably with priorit... (by TheHardew)
January 2016 Pages: 1... 7891011... 18
  Archived months: [dec2015] [feb2016]

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