General C++ Programming - July 2011 (Page 8)

How can i change this bit?
 
#include <bitset> #include <iostream> using namespace std; int main() {int a=25,b; bitset<8>binarya(a); cout<<binarya<<endl; binarya =0; cout<<bi...
[2 replies] Last: Thank u for ur help. (by Helegurbann)
by teocl5
String data not stored after the spaces
 
Hi all experts, I would like to know how come the string variable doesn't store the entire data entered. for example, cout << "Product name: "; cin >> e...
[5 replies] Last: I have solved this problem already! Simply use cin.ignore(); (by teocl5)
Question on Article "Headers and Includes: Why and How" (by Disch) -- inline!
 
Hi! Regarding the article "Headers and Includes: Why and How": Please see ** 7) Function inlining ** http://cplusplus.com/forum/articles/10627/#msg49682 I fo...
[4 replies] Last: Wow, yes it works if one pulls the include before the guard. I was tr... (by JohnBrystone)
by jpotts
Variables
 
Hey, When you define variables you say something like int length; however, what would you use instead of "int" if you wanted to use a string of characters, ...
[2 replies] Last: Excellent, thank you :) (by jpotts)
How to find the function symbol in nm or objdump when using shared_ptr for abstract class?
 
Hi, I use shared_ptr for an abstract class ABC as follows: typedef boost::shared_ptr<ABC> ABCPtr; ABCPtr get_ABC_ptr() { return ABCPtr(new ABCImpl())...
[5 replies] Last: The only thing the compiler needs at compile time is the header file. ... (by jsmith)
graphics issues
 
mkay, before i start posting my problems and walls of code, this is more a direct3d related issue than just a c++ related issue, would this be the right place t...
[15 replies] Last: Go make your own thread about it. This is no place to ask about your o... (by hamsterman)
trying to make a text base pokemon game
 
im making this just to get the feel of using c++ in a game directed format and a demo is better than a resume. //define all pokemon as objects class pokem...
[9 replies] Last: there can be an array of pokemon- //headers using namespace std; i... (by Pranay Venkatesh)
C++ Subtraction calculation error!!
 
#include "stdafx.h" #include <stdio.h> #include <math.h> #define PI 3.14159265 void main() { char Continue; do { int Amount, k; char Choice; float num, Deg; ...
[4 replies] Last: Given your input and arithmetic above, think about what is happening..... (by closed account DSLq5Di1)
by Rob S
Problem with some code for a game hack.
 
Nvm.
[no replies]
how to execute system command from textfile
 
Hello any help about this code? this code read a command from text file but when i try to execute it using "system" i get error see the code bellow. c++ cod...
[4 replies] Last: it is working now thanks.. Mathhead200 (by jhovarie)
Strange Issues with code
 
Basically, when I try to compile my program, I get these 4 errors (line 67 is marked in the code) ~\projects\meals decider\meals decider\Meal.h(67): error C232...
[2 replies] Last: Haha, thanks! I must have looked at that line of code over a hundred t... (by Hibblejaybob)
How to display the text from a text file in rows?
 
Hi guys, Facing another issue. I have a text file with some data. When I add records to this text file, it will save as such: table:200:21022011 chair:1...
[no replies]
'blah' was not declared in this scope, even though it was
 
I'm trying to make a program which generates a random 4 digit number with new and delete. Here is my code: #include <iostream> #include <cstdlib> u...
[5 replies] Last: You should create one int. It should be : pin = new int; Then use ... (by Nisheeth)
Overloading Vector Functions Without Overloading
 
The title is almost illogical, but I was trying to be clever. Anyway, this is more for functions requiring vectors than anything else. I'm wondering if there...
[2 replies] Last: The most general form would be template< typename T, typename Alloc... (by jsmith)
by alhanz
A small question about CPPunit testing
 
Hey everyone, I got a small little question about cppunit. I'm kinda new to it. I tried using some simple methods to test cppunit. It was a successful. Howev...
[1 reply] : anyone knows? (by alhanz)
Two-Dimensional Arrays
 
Hello all, I'm just learning how to program in c++ and I have a hw assignment that I'm very confused on if anyone can help that would be awesome! Here is my pro...
[2 replies] Last: Thank you! I'm not sure I understand his response anyway you could hel... (by snooze826)
I need help
 
http://cplusplus.com/forum/general/47348/
[no replies]
Sudoku Solver Help
 
Hello everyone I am new to this forum so please forgive me if I say something stupid. I would like to make a Sudoku Solver and I would like to use GUI so th...
[2 replies] Last: Thank You so Much!! Your answer was so detailed and helpful I have sta... (by TheMassiveChipmunk)
How can i make this image?
 
#include <fstream> #include <iostream> using namespace std; int main(){ fstream file1,file2; file1.open("C:\\Exam.jpg",ios::in|ios::binary); file2.open...
[no replies]
Alternate Build Utilities
 
This is probably a silly question, but I couldn't seem to get the answer while Googling. What are the equivalents of Make, NMake and MinGW-Make for Borland C++,...
[no replies]
July 2011 Pages: 1... 678910... 30
  Archived months: [jun2011] [aug2011]

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