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

Help with libmysql
 
I'm trying to connect to my database using the following code: #include <iostream> #include <conio.h> #include <math.h> #include <cstdlib> #include <i...
[no replies]
Regex
 
I was a little confused about the regex explanation on this site. What syntax do I have to use to do simple matching? Thanks!
[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_command(char *input, char *command,int*num_params, float *para...
[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 __MyCompanyName__. All rights reserved. // #include <allegro5/a...
[11 replies] Last: Ah yes. The push_back must've invalidated the iterator. You'll proba... (by cire)
error
 
Hi.Here's my code: char s ="76111"; while(*s) cout << s-- ; Why do I get error on the last line? Please run it on other platfor...
[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 the pair I want to swap with the first pair in the map. thi...
[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 doesn't enter a string that is not in the array i want to ask th...
[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 population is 10 and it consists of 28 binary bit. Here is m...
[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 once an array is full I have a function that creates a new a...
[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 might be interesting to emulate it in SFML. To that end I've i...
[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 that output file is not showing total of the salaries.. ...
[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 and stuff) their clients or do they use a different method ...
[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 http://www.mustat.com/50.22.100.250 (Ip host www.cplusplus.com) . I see hex IP : Hex IP 0x321...
[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 itself to another variable. eg int Coins = 0 int Amount ...
[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' a=3; } else{ a=5; } int c=a+2; cout << c; And what I want ...
[2 replies] Last: you could try to assign a as 0 when your declaring the variable int ... (by Steven Menzies)
for loop pause
 
I'm having an issue with my for loop. Basically what i'm doing is i'm making a virtual hangman game for one of my labs in school. I put a for loop to loop thr...
[3 replies] Last: @Steven Menzies Yeah, I think the tweak was changing bool ok = true;... (by whitenite1)
triangle
 
// Includes #include "stdafx.h" #include <iostream> #include <conio.h> using namespace std; // Main Function void main() { int x; int y; cou...
[2 replies] Last: ah ok. thank you, i see and understand now, thanks for the help, white... (by Reaper1)
Random Numbers
 
I am developing a program that will generate algebra problems and answers for me to use for studding at home. I need to make some random numbers but every time ...
[8 replies] Last: int random = (rand() %5) + 1; (by soranz)
rectangle
 
// Includes #include "stdafx.h" #include <iostream> #include <conio.h> using namespace std; // Main Function int main() { int a; int b; int length; int w...
[4 replies] Last: Mark the both your threads as resolved.:) (by vlad from moscow)
Quick question on a return
 
// Includes #include "stdafx.h" #include <iostream> #include <cstdlib> #include <ctime> #include <conio.h> using namespace std; // Prototypes int addition();...
[5 replies] Last: oh ok, thank you. (by Reaper1)
September 2012 Pages: 1234... 32
  Archived months: [aug2012] [oct2012]

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