General C++ Programming - September 2012 (Page 2)

Pre and post increment
void main() { int a=1; printf("%d %d %d",a,++a,a++); } How come the output is 3 3 1.Sho...
[6 replies] Last: It means that literally anything at all can happen. http://www.catb... (by helios)
I need help with the calculation part of this program urgently i am new to c++
#include <iostream> #include<string> using namespace std; int main() { //variables// strin...
[1 reply] : Hi ! Use code tags please. I notice that this early: if(Gender == "m... (by soranz)
by twicey
program using array need to find the position of the number
please take a look at my current work. thanks #include <iostream> using namespace std; int ma...
[3 replies] Last: //from line 16 cin >> innum; for(int i=0; i<n; i++) { if(a == inn... (by soranz)
Adding too many includes
I have many individual classes for components. Some are Buttons some are Windows and so on. Each cla...
[3 replies] Last: It's difficult to say. Design decisions are never "once size fits all... (by Disch)
Template chrono problem
I have the following problem. I attempt a timer using "chrono" attribute-based templates. The pro...
[3 replies] Last: Yes, that works too, but it's not too different from just moving the d... (by helios)
Help with libmysql
I'm trying to connect to my database using the following code: #include <iostream> #include <...
[no replies]
I was a little confused about the regex explanation on this site. What syntax do I have to use to do...
[1 reply] : As far as I know the syntax used by std::regex and boost::regex are id... (by R0mai)
by talya7
Command with parameters
How to fix my program using C not C++ #include <stdio.h> #include <string.h> void func_co...
[2 replies] Last: Thank you. I am trying to output the command, the number of parameters... (by talya7)
Iterator loops forever ?
// // main.cpp // Snake // // Created by Angel on 9/25/12. // Copyright (c) 2012 __MyCom...
[11 replies] Last: Ah yes. The push_back must've invalidated the iterator. You'll proba... (by cire)
Hi.Here's my code: char s ="76111"; while(*s) cout << s-- ; Why do I...
[7 replies] Last: I guess I found the problem.It wasprobably modifying the constant poin... (by hooshdar3)
Swapping two pairs in a map with a unique_ptr
I'm having some trouble with this, I have a map of <string, unique_ptr> and an iterator pointing to ...
[4 replies] Last: I was trying to implement a state machine for SFML, I did actually get... (by Zephilinox)
while loop with array condition
I have this array and i am asking the user to enter a string that is in array, but if the user does...
[3 replies] Last: THANKS I got it to work (by johnhuge)
Help with Array
I'm trying to build a population for my Genetic Algorithm Project using an array. The number of the ...
[4 replies] Last: Okey dokey!! Thanks everyone! (by MirzaAdrian)
Dynamic Arrays and DAM
Hey I need a way to check if a Dynamic Array is full. I am writing a check program for class saying ...
[5 replies] Last: In that case, never mind. Just stick to the manual size check whenever... (by JellyFox)
by cire
Are pointers the best way?
So, somehow I ended up watching a video animation of a sort working on youtube, and I thought it mig...
[2 replies] Last: Thanks for the input. I was half-thinking the source could serve as a... (by cire)
adding salaries from file
i want tO add the salaries from a fiLe tO the prOgramme aLL the cOde is compiLing but the problem is...
[1 reply] : Is your lower-case 'o' key broken? Anyway, have you tried using the '>... (by JellyFox)
How often should a server update
In most professional games how often do servers update (not as in patches but other player positions...
[no replies]
How to convert IP to hex using C++ (1,2)
Hi guy . I don`t known how to convert IP to hex . In this link
[22 replies] Last: In this case both structures allocated the same amount of memory (4 by... (by JAL)
Adding 2 variables
I know how to add 2 variables and cout it in a third variable, but how can i make one variable add i...
[2 replies] Last: yuppers, just like peter87 stated. (by Reaper1)
Question about if statement
Hi, I wrote the following code int a; cin >> a; if(a== 2) { // btw do I need to single quote '2' ...
[2 replies] Last: you could try to assign a as 0 when your declaring the variable int ... (by Steven Menzies)
September 2012 Pages: 1234... 32
  Archived months: [aug2012] [oct2012]

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