General C++ Programming - March 2012 (Page 4)

How to set a booleon variable to true within a GLfloat array?
 
Hey all Trying to work out how to set a booleon variable to true within an float/glfloat array any ideas on how to do this. bool test = false; //GU...
[2 replies] Last: right after the last row of values in the array where it says test = t... (by Noobscratcher)
Converting an Integer to Binary
 
I am writing a program that converts any integer into binary. I have provided a working program that outputs the values of an array that stores the necessary on...
[4 replies] Last: There is no 'conversion' here. Just building a string that correspond... (by cire)
cos, sin and tan
 
I found the following information sin(x) = x - (x^3)/3! + (x^5)/5! + ... + (-1)^i*(x^(2*i+1))/(2*i+1)! cos(x) = 1 + (x^2)/2! - (x^4)/4! + ... + (-1)^...
[7 replies] Last: By the way, L B, silly programmers would prefer something like this: ... (by Kyon)
SIMPLE TIC TAC TOE
 
#include<iostream> using namespace std; void display(char b ); void play(char b , char turn); int main(){ int x, y(0); char b ={'1','2','3','4','5',...
[2 replies] Last: I was bored so i took the liberty of doing it for you, quite a fun pro... (by GFreak45)
by LB
The implicit 'this' parameter
 
struct test { void func() { std::cout << (void*)this << std::endl; } }; int main() { auto f (&test:...
[5 replies] Last: I was just curious. Last question: is it guaranteed to work if I pass... (by LB)
Problem with arrays
 
I made a mistake and I don´t know how to solve it... It´s strange because I don´t know what I did wrong. This is the code. for (i=0;i<=n;i++){ n...
[3 replies] Last: It's these two lines of code (at line 19 and line 32): x =Lx; y =Ly;... (by Torin)
by cshu
help
 
Im having trouble building my program, I keep getting these errors: Build started: Project: prgm2, Configuration: Debug Win32 ------ 1>Build started 3/29/201...
[4 replies] Last: Dev-C++ is deprecated since a while ! Consider using wxDev-C++ instead... (by Jessy V)
General Dataset problem (interbase)
 
Hello, I am trying to get to work a local interbase SELECT-UPDATE connection. The problem is: Componens: IBDatabase with its IBTransaction and a IBDataset(I...
[no replies]
2005 link error - already defined in
 
Hi, When I compile the code below i have the following error message. Thanks in advance. 1>Generating Code... 1>Compiling... 1>SimpleMC.cpp 1>Gener...
[4 replies] Last: Ok, It is fine now. Thanks. (by MoonDragon)
Initializing Variables (C++ programming)? (1,2)
 
I'm struggling to understand why we initialize variables in C++ though I have some idea. Could anyone explain this to me. I have the books and have read the...
[28 replies] Last: There's no "right syntax". Everything boils down to: never use the val... (by Athar)
by Zapeth
Boost.Asio use class with option for SSL
 
Hi all I have a set up asio SSL socket boost::asio::ssl::stream<boost::asio::ip::tcp::socket> socket_ and the connection to a client that uses SSL works just ...
[no replies]
Unintended Lines And Boxes
 
I have a program, using OpenGL, which, simply put, is just a large collection of cuboid however, despite not being in the code, in release mode a random line co...
[2 replies] Last: It was an initialised variable in the cuboid class. I didn't realise t... (by closed account 2NywAqkS)
How do you make a section of this program inaccessible, after being run once?
 
I am making a 20-question quiz. The previous ones I have made make a question able to be re-accessed after they answer it. Is there a way to make a question, or...
[4 replies] Last: @therockon7throw, Whoops! Forgot line 7. (by Stewbond)
Adding a Form Icon - An Unhandled Exception.
 
Hi guys, I am writing a CLI program with multiple forms. I am trying to put an icon in the top left corner by changing the value in the 'Icon' setting in the...
[1 reply] : Best if you post @ the MSDN forums. Almost nobody here knows C++/CLI. (by webJose)
problems with a array
 
this is my code: for (i=0;i<=n;i++){ nodx = Lx/((n-1)*2)+Lx/(n-1)*(i-1);} nodx =0; nodx =Lx; for (j=0;j<=m;j++){ nody = Ly/((m-1)*2)+Ly/...
[no replies]
by drew99
Problem with multidimensional vector
 
My problem is this: in the main function declare a vector cubic in three dimensions. int cubic ; After processing user input, I have to pass the ve...
[4 replies] Last: Why after allocating dynamically the vector three-dimensional cubic, I... (by drew99)
Connecting to MySQL
 
I'm creating a console based game, with account login to a MySQL database(at least I'd like to to it) so what would be a simple way to achieve that? I've g...
[15 replies] Last: I use GNU under Ubuntu and MinG under Vista. I did this under Ubuntu r... (by BHX)
WHATS THE DIFFERENCE BETWEEN C AND C++?
 
Hi there, i'm studying C++ at Varsity. I just want to know what the difference is between C and C++.
[5 replies] Last: @Moschops i think i understand. thank you very much. much appreciated. (by ayanda83)
Many undefined references
 
So I am getting undefined references timer.H #ifndef _timer_H_ // include file only once #define _timer_H_ /*---------------------------...
[8 replies] Last: Thanks cire! That was it! Forgot to do that (by phillyman1025)
Data members layout in memory
 
Suppose i have a struct with data members of same type: struct foo { int a; int b; int c; // is this safe? operator int* () ...
[4 replies] Last: Ok. Thanks. (by morando)
March 2012 Pages: 123456... 49
  Archived months: [feb2012] [apr2012]

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