General C++ Programming - May 2016 (Page 10)

Delete a number given by user in a vector
 
For this program I would like any instance of a given number to be deleted from my vector while still maintaining the order of the vector. I have successfully ...
[9 replies] Last: > That last bit is what is giving me trouble; shifting the elements ov... (by JLBorges)
by Blenda
Can you help me please?
 
Hello guys, I am really sorry for disturbing you, and I really do not know how this forum works, but I need your help. I am working with some exercises but I ...
[1 reply] : Double post: http://www.cplusplus.com/forum/beginner/191007/ (by chicofeo)
How do calculators avoid floating-point precision errors?
 
I've tried to write the program for a calculator before. It turned out fine, able to do the basic calculations and evaluate whole expressions. But if I type in ...
[3 replies] Last: > And what data type do they use (is it long double)? See: 'Using Bin... (by JLBorges)
Plot coordinates program
 
Hey guys, I have written a program that converts from Cartesian to Polar coordinates and vice versa. Now I am told to draw a very simple graph (a vertical and a...
[3 replies] Last: Yes. There are many external libraries available for C and C++. (by Moschops)
Stuck in my project:Fill the ship with products (max efficiency)
 
Hey guys, I will start my simple project but I still confuse about the main points. Here basic story of my project: Imagine that one little ship has got one...
[1 reply] : This is a common CS problem called the Knapsack problem . Read all ab... (by Duthomhas)
Problem with Multi-dimensional Arrays
 
I'm writing a program to play tic-tac-toe using multi-dimensional arrays but I'm having trouble plugging in the x's and o's because the indexes only exist withi...
[2 replies] Last: "because the indexes only exist withing that first nested for loop" Y... (by Duthomhas)
by helo12
Binary search using a random array of integers--Sort problems
 
So I am trying to use a sort function before inputting an array of random integers into a binary search function first I tried using std::sort but that ran me ...
[4 replies] Last: Thank you guys very much for the help (by helo12)
by jirals
How to make a loop in a strlen?
 
Define a string, then create a program that asks a user to enter something, then displays the number of characters entered with the message: You entered XX Cha...
[5 replies] Last: http://www.cplusplus.com/reference/string/string/ (by helios)
NewBie with a question or two
 
Hello. I have recently downloaded a "Turbo C++ program" from the internet. But I am wanting to simply learn the C++ programming language. Can I ask questi...
[19 replies] Last: I think actually I did it. SC (by spacecadet11)
by xrosax
How to normalize the screen height and width?
 
Hello just wanted to know the simplest and most efficient way to normalize a value of screen width in this case GLfloat WIN_W = 640.0f; and screen height in...
[3 replies] Last: The way to think about this is two steps. First, scale. You have a l... (by Moschops)
Pointer Study Guide Question
 
I'm having issues writing this program. Pointer Rewrite The following function uses reference variables as parameters. Rewrite the function so that it uses po...
[7 replies] Last: While I think @MikeyBoy may have been just a little bit too sarcastic,... (by doug4)
by modkip
defining int with variable name
 
Hi, i am trying to make a program that can set a variable by a non-static name, something like this: string variable_with_name_of_int = test int (conte...
[6 replies] Last: Thanks JLBorges, this is exactly what i was searching for! I have not ... (by modkip)
typedef question
 
I am trying to understand how to define a typedef in general and how to specifically apply it below: bool(*n_ptr)(int)(int) I know we start with: typede...
[18 replies] Last: [quote=Cubbi]that's an alias to a pointer to a function Good catch. ... (by MrHutch)
Inheritance of abstract Class
 
Hello, I am currently playing around with inheritance and polymorphism. I programmed a RLC-Circuit and i want one abstract class, and the three elements (Coi...
[4 replies] Last: It compiles fine for me too. The thing I'll point out is you only need... (by BHX)
Close And Open A New One
 
im making a game and i want the program to close the command prompt and open a new one. how do i do this?
[1 reply] : start cmd.exe ? (by SamuelAdams)
by Burden
Need help to fix the function
 
class Demo { private: int value; public: int getValue() { return value; } void setValue(int value) { value = value; } }...
[2 replies] Last: Thanks a lot. It works! (by Burden)
Visual Studio 6.0, C/C++ error C2065: 'SSLv2_client_method' : undeclared identifier
 
Hello, I'm using Visual C++ 6.0 in Visual Studio 6.0, SP6 on a Windows XP computer. I'm trying to build an existing C++ source program that was originally cre...
[5 replies] Last: It's common, when writing C and C++ code for various target systems, t... (by Moschops)
How to safely return int pointer
 
I have a lookup function in my hash table class which returns a pointer to the hash table bucket if the element x is found. Is this a safe way to declare a poi...
[4 replies] Last: No. int *BukPtr = new int; *BukPtr = bucket; or int *BukPtr = ne... (by helios)
Easiest Shortest Path C++ Program *Possibly*
 
/*This is a complete and correctly functioning Shortest Path algorithm in C++ using Dijkstra's Algorithm. For information on how Dijkstra's Algorithm work...
[8 replies] Last: Lol it does. 'A' does not equal 'a'. I placed the example input with c... (by MazharMustapha)
Draw circle using Trig functions
 
Hello, can someone help me out? I am trying to draw and display a circle on the CMD using Trigonometric functions like Sin and Cos. How can I go about drawing s...
[1 reply] : void t_25() { double fi,fir; double rad; double x,y; int nl; ... (by skaa)
May 2016 Pages: 1... 89101112... 17
  Archived months: [apr2016] [jun2016]

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