General C++ Programming - March 2011 (Page 3)

by macMod
Help ARRAYS
 
I have an assignment due that has been racking my brain for a week and I just can't get all the pieces to fall together. Any help would be appreciated. Writ...
[19 replies] Last: The null termination was not needed actually. I just forgot there were... (by benjelly)
by ivanBG
Decimal to HEX value help
 
Hi, i am making a little c++ program, that should generate a .bmp file. The problem is that after calculating the file width value I end up with a decimal and I...
[2 replies] Last: Thanks, got it working! (by ivanBG)
SQL/C++ Programming
 
#include <stdlib.h> #include <iostream> #include <cstring> #include <string> /* Include directly the different headers from cppconn/ and mysql_driv...
[1 reply] : It's a string right? Do know how to format a string? Just encase you... (by kbw)
Error saying expected primary expression before 'float'
 
So I'm having a problem with my code. I'm trying to make a program for linear regressions and everything else is working for now but I'm stuck on the error that...
[1 reply] : this double x_y_sum=sum(float x ,float y ); double x_sum=GetSum(float... (by coder777)
Char Array Update
 
I am having a really hard time updating the array for char. I am making hangman game, in which char board[WORD_LENGTH+1] = "-----"; and in the following functi...
[5 replies] Last: it worked beautifully thanks fun2code (by sparcer)
by mux77
stuck on loop for (infile.fail())
 
I am trying to get this code to get the user to correctly enter the ifstream file by using the if(infile.fail()) statement. it catches the failure, but when I ...
[11 replies] Last: yeah, I have been using mydocument.txt. Don't worry, it is 11:40pm he... (by mux77)
arrays, nested loops
 
project instructions http://i.imgur.com/IGT4X.jpg http://i.imgur.com/TMJZI.jpg I have a project due Friday and I am a little stuck so far i have #include <i...
[3 replies] Last: Start with the first requirement: a constant of MAX_SIZE. Make sure y... (by PanGalactic)
Please Help - Programming Project
 
I am to make an application that will grade a multiple choice exam with 10 questions. Here are the correct answers for the exam. 1. B 2. D 3. A 4. A 5. C 6. A 7...
[1 reply] : Take each step one at a time. In main() I am to define 2 arrays. Ini... (by PanGalactic)
How do I count no 0 as one digit?
 
Hi, may I know how do I count number zero as one digit? My code for converting a series of number into a digits is like this (Bear in mind number belong to ...
[6 replies] Last: Although cin ignores leading zeros, be aware that literals with a lead... (by moorecm)
When to start with SFML
 
I'm currently programming console programs, and are still pretty new to C++ (been programming for about a month now, though several hours a day). I've seen grap...
[8 replies] Last: Just to throw my two cents in: Is It More Complex? Yes, there is mo... (by Computergeek01)
what function do we use?
 
Hi, What function do we use in order to identify between a letter and a number in a string?
[6 replies] Last: Great! It works. Thanks! (by student 123)
by bacero
Help With Pacman Program
 
As you all probably know, the enemies, or "ghosts" as they're called, don't stop moving, unless they are in the cage. I was wondering how i can make a program m...
[5 replies] Last: If you're on windows, you can simply use getasynckeystate... I still t... (by ultifinitus)
recursive templates ?
 
I could easily write a recursive list (list that contains lists) without templates ( struct list{ list *object, *next; }; ), however I can't figure out a way to...
[5 replies] Last: I've once managed to make g++ compile forever because of recursive tem... (by Bazzy)
Code::Blocks, G++, and Ubuntu
 
I have successfully install Code::Blocks( 10.05 ) within Ubuntu and downloaded and installed G++( sudo apt-get install build-essential ). However, when compil...
[2 replies] Last: Thank your for your reply, Bazzy. It was my mistake. I didn't install ... (by closed account zb0S216C)
Need help.
 
I have code to write to a csv file. The code gives me a file that looks like this; aaaa aaab aaac aaad and so on. i would like to make it so that t...
[1 reply] : I found another problem with the code. I need help to fix: it writ... (by toadmar)
Problems in delete[] when called from fortran
 
Hi, I have a library I wrote in C++ and I have fortran wrappers to call the function from fortran. I am having some problems while de-allocating the memory. ...
[3 replies] Last: Have you tried doing the allocate and then immediately doing the relea... (by kbw)
wxString to wxDateTime
 
Hi, I have this problem with the unserialize function.. To serialize i've used the function FormatDate() that returns a wxString but there is no function that...
[1 reply] : To serialize i've used the function FormatDate() that returns a wxStr... (by coder777)
client-client chat application
 
Hello Experts, I have created a chat application between a server and client using winsock and using multi-threading. I want to extend it to chat between cli...
[1 reply] : Will you please elaborate your requirement? Can't understand 'client ... (by richardforc)
&& and move function
 
I got this code: class A; A&& foo() { A a; return std::move(a); } My question is: Should I get better performance if I use A&& a = std::move(foo()); ...
[1 reply] : std::move is needed to convert a l-value reference to an r-value refer... (by Bazzy)
Assigning an array to another array?
 
Why can't you assign an array to another array, but you can use arrays as parameters and arguments? Lets take this example: Say this is a function prototyp...
[1 reply] : for the same reason for which the following works int writeString(con... (by simeonz)
March 2011 Pages: 12345... 31
  Archived months: [feb2011] [apr2011]

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