General C++ Programming - June 2014 (Page 10)

Help please on basic error
 
cout<<"************************************************************************"<<endl; cout<<"|\t\t\t The Company Finance Department"<<endl; cout<<"|Employ...
[3 replies] Last: On line 6, remove the ; at the end of the line. Same thing on line 11... (by Stewbond)
How to extract and modify a "sub-vector"
 
I have a std::vector<int> and I want to modify subset of the elements. I thought I might be able to use: std::vector<int> a = { 1,2,3,4,5,6,7,8,9 }; ...
[3 replies] Last: I mean something like std::for_each(a.begin() + 3, a.begin() + 7, (... (by Cubbi)
by homing
C++ Program Bug need Help
 
Hey, I've got a problem in the following program: (actually it's a little simulation of another program, so i've chosen really bad variable names/function n...
[4 replies] Last: thanks man. it's working now :) (by homing)
need help for typecasting
 
How can you convert int type to const char*
[2 replies] Last: const char * text = "Some words."; cout << text << endl; ... (by Chervil)
Just starting C++ Curious on what to learn for basic projects
 
This is what I need to learn by next may, plenty of time, but no idea where to start on these, I have some basic background of C++ 2) [20 points] Simply Divi...
[3 replies] Last: Write a program that takes in a division, and instead of outputting t... (by kbw)
Tag Mobility Code
 
Hello experts, I really need help with this problem. I divided my question into three sections, Initialization, Implementation and Output. Basically Initializat...
[6 replies] Last: So does that mean you're simulating a vehicle that moves around with a... (by coder777)
by bonho
real time processing
 
I'm developing a platform that is expecting to receive signals, process them, and react by sending its own signals. I haven't done this in C++ before so I'm wo...
[5 replies] Last: My in-signals are generally network messages or internal messages with... (by bonho)
Given a parameter pack, create any new one from it
 
First basic kind: template <int OMIT, int TAKE, typename TUPLE> struct partial_tuple_concrete { typename partial_tuple_from_tuple<OMIT, TAKE, TUPLE>::...
[10 replies] Last: Ok, I think we are done then. And I thought of a very general applica... (by prestokeys)
by JJ1972
Change length of an array using gdb
 
I have a program with the following code, and I need to be able to either change the value of any or all of the strlen or to replace one or all with a temp arra...
[1 reply] : To store values into arbitrary places in memory, use the `{...}' cons... (by kbw)
Pointer data members!
 
From many literature sources(online and print), one is instructed that if a class has a pointer data member, one needs to explicitly overload the assignment ope...
[2 replies] Last: The compiler-generated copy constructor and assignment operator will c... (by helios)
How to retain fraction form, not decimal of division
 
I need to set something up whereby the result of 10/4 = 10/4, not 2.5. Basically if the result isn't an integer, I need my calculation to remain as an integer,...
[6 replies] Last: boost::rational<int> r( 44, 14 ) ; // 22/7 int numerator = r.numerat... (by JLBorges)
While loop
 
I have a question, how could I use c++ to try and figure out a password. If you are wandering, yes I am trying to hack a program but to be fair the program I am...
[1 reply] : You would launch the batch file with CreateProcess from the WinAPI and... (by Computergeek01)
How to include spaces in counting string characters
 
So i have this program that's supposed to count all the characters including the spaces without using strlen but it only counts the number of the first word's c...
[5 replies] Last: Ok. For now, you could use a for loop if you wanted to repeat someth... (by Chervil)
by Rosen
Need an advice for a program !
 
Hello guys ! So I made this program: #include <iostream> using namespace std; enum BOOL { FALSE, TRUE }; typedef unsigned short int USHORT; USHORT menu()...
[1 reply] : There is so much wrong with your code, where do I start ? :) Pleas... (by Codermik)
Pass by const copy
 
I have never seen anyone pass by const copy and there probably is a reason. I know that the compiler ignores top level const-ness of function arguments. There a...
[10 replies] Last: @Galik I think that your solution of using const qualifiers for the a... (by benbalach)
Radix Sort Not working
 
Hello, I'm trying ultimately to do a radix sort. I'm going with the implementation using two tables. One will initially hold the unsorted values then hold the ...
[2 replies] Last: naraku9333, I changed that part to: void radix::insert_into_sorted ... (by Joshua Schweigert)
Need help finding error in 8086 emulator
 
Can someone help me finding the error(s) in my x86 emulator? I've based the CPU opcodes on fake85, with my own adjustments for my written CPU/MMU system. Fol...
[4 replies] Last: I simply need to know in what order to test the instructions. I use th... (by superfury)
by GoranD
Template function overloading resolution different in VisualStudio and GCC
 
I stumbled upon an unexpected difference between GCC and VisualStudio: Different overloaded functions are called in the following example: // -------- ca...
[2 replies] Last: Thanks for the reply. I checked the C++ standard, 14.6.4.2 is exactly... (by GoranD)
by Kubani
Hexagon Class
 
Hello all, The exercise 8 of chapter 13 of book ( http://www.stroustrup.com/programming1.html ) says: Define a class Hexagon (a Hexagon is a regular six s...
[6 replies] Last: About the fl_line() , yes, that's it but I haven't understood how tho... (by Kubani)
by Eevee
Decimal Problem: setprecision
 
So after slaving away at making a BMI calculator and making it work for both metric and standard measuring systems, I can't get the program to display the BMI w...
[3 replies] Last: @whitenite1 Gotcha, that explains why if I ran it using metric it'd s... (by Eevee)
June 2014 Pages: 1... 89101112... 21
  Archived months: [may2014] [jul2014]

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