General C++ Programming - July 2014 (Page 24)

Program not outputting
 
I wrote a program to grade T or F test. It is running, but not outputting the information. #include<iostream> #include<string> #include<fstream> #inclu...
[5 replies] Last: I just realized mine was off too. I needed to multiply the % by 100. I... (by Yay295)
by zf7
beginner tic tac toe game
 
This is my code, and the problem I am having well maybe what I need to add is instead of "Player 1" and "Player 2" I need to have people input their names and h...
[7 replies] Last: I'm using borland because that's the only compiler I have and my profe... (by zf7)
String to Double Function
 
Because MinGW C++ doesn't have the atod() or atoi() functions for some reason, I had to code a string to double function myself. I think it's working correctly...
[1 reply] : If you don't have access to atod or atoi then it's conventional to use... (by Lachlan Easton)
by twesna
Looping Problems
 
So I am trying to write a program that asks the user for a name. If the user enter the right name the program ends but if the user were to enter the wrong name ...
[9 replies] Last: Thank you i made a mistake in the setting when using visual 2010. It w... (by twesna)
Using .NET Inside C++
 
I'm trying to use some .NET Features inside C++, such as : http://msdn.microsoft.com/en-us/library/System.Windows.Controls.Image(v=vs.110).aspx I've tried put...
[4 replies] Last: I see., Thank you. (by AmitM9S6)
calling a fiction though a variable
 
I am trying to call a function though a variable Please tell me what I am doing wrong The error |error: no match for 'operator=' (operand types are ...
[3 replies] Last: It would compile if that's what you mean. I wouldn't say it "works" qu... (by Computergeek01)
pass by value and pass by reference
 
// explain difference between pass by value and pass by reference void addOne(int i) { i++; } void addOne(int& i) { i++; }
[2 replies] Last: When a variable is passed by value it copied into the stack. This mean... (by Computergeek01)
8086 illegal rep prefix?
 
What happens when rep is used with illegal opcodes (non string instructions, like call)? is the prefix ignored or is the whole instruction skipped? (I know the ...
[no replies]
by manojg
strlen of c-string
 
int main() { int len = 8; char temp1 ; char temp2 ; char temp3 ; cout << strlen(temp1) << "\t" << strlen(temp2) << "\t" << strlen(t...
[9 replies] Last: Thanks. I am using gcc 4.8.3. make the array dynamic or prefix it wi... (by manojg)
NEED URGENT HELP!
 
so i have a computer game programme, but it is showing an error when i compile, error:- main.cpp|128|error: expected ';' before 'ms'| i have recheked the wh...
[1 reply] : MenuState is a const int, not a type. (by helios)
SDL - Destroying SDL_Textures*
 
Hello, So I have a SDL_Texture* wrapper called CTexture that just has a private member of SDL_Texture* which stores an image of the texture in question. I wa...
[1 reply] : Yes, it's valid as long as you don't reference your texture again. (by Avilius)
Random Number
 
How to do a numbers input, randomize the numbers using something called Fisher Yates shuffle? This is my first time using this shuffle so I dont know how to sta...
[18 replies] Last: To pass an array to the function you just put the name (without ). (by Peter87)
What am I doing wrong?
 
It wont shuffle #include <iostream> using namespace std; void my_swap(int &a, int &b); void my_shuffle(int a , int n); int main() { int a; const i...
[2 replies] Last: So first off, your my_shuffle(a) is using an integer argument that h... (by Aaron Vienneau)
Plz help
 
So if I have an array how do I convert it to a balance binary tree?
[1 reply] : You can sort the array, and then take the middle value as the root nod... (by closed account 10X9216C)
how to find and replace in text file
 
Hello right here I have a program that gives the user the option to create an employee ID, name, address and so on. It also has the option to search employee by...
[1 reply] : What I want to know is how to add and replace employee info. For exam... (by coder777)
Type Casting in C++
 
class Cint { int a,b; public: void display() { cout<<a<<b<<endl; } }; class Cchar { char x; void show() { cout<<x<<endl; } }; ...
[2 replies] Last: YOu have used an unsafe C-style cast. In this case it works as reinter... (by MiiNiPaa)
Hold key problem
 
Hello guys! I have a question for you and I'm sorry if I'm wasting your time. I made a game in C++(I'm in high school so I don't know a lot of things). My pro...
[9 replies] Last: Problem solved =D! if(GetKeyState(VK_A)<0 && joc[hM-1] !='*' && joc[h... (by creative3000)
Simulating 2D array with 1D array?
 
Hi, I'm trying to simulate a 2D array using a 1D array. The array looks like the following: const int MAP_WIDTH = 20; const int MAP_HEIGHT = 10; const unsig...
[4 replies] Last: 2D matrix coordinates are in format {row, column}, where the row numbe... (by MiiNiPaa)
Get angle of bullet after bouncing
 
I'm trying to make a bullet bounce after it hits a wall. I think bouncing on the top and bottom wall works perfectly, but it won't bounce off of the left and ri...
[3 replies] Last: I tried some more code and I still can't get it working right. It kind... (by Bingocat4)
Says no operator "==" matches these operands
 
#include <iostream> #include <string> #include <cstdlib> #include <time.h> #include <windows.h> using namespace std; int main() { int x; std::strin...
[1 reply] : // if(Cat == 'Yes') if( Cat == "Yes" ) (by JLBorges)
July 2014 Pages: 1... 2223242526
  Archived months: [jun2014] [aug2014]

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