General C++ Programming - January 2012 (Page 6)

StreamWriter output coming out as 'true'
 
Hi, I'm having a problem with using the streamWriter to write to a unicode file. Code as follows: for(int i = 1; i < 1018; ++i) { std::wostringstre...
[3 replies] Last: The System.String class of .Net is 100% Unicode. Or better said: Al ... (by webJose)
Random number problem....Its not random
 
What am I doing wrong! #include<iostream> #include<vector> #include <cstdlib> #include <ctime> #include<windows.h> using namespace std; class Chairs ...
[1 reply] : Solved it void setStatus() { int rand... (by mahinkhan22)
wxWidgets related...
 
I'm having a mind block on this one so I thought I'd ask if anyone can tell me what I did wrong. DBI::DBI(void) : wxTreeItemData() { afr = 0x00; afi = 0x0...
[1 reply] : I figured out why it was complaining, it was to do with how I created ... (by awsdert)
file separation
 
I am using Dev C++ as a student, know theory more than practice, I want to write a program for making classes and their objects. But I don't know how to save he...
[no replies]
Deallcating built in data types
 
What is the way to deallocate the built in data types?? Example : class A { private : int a,b; } In main--> A a1=new A(); Then how to deallocate t...
[3 replies] Last: No, you can't do that. A call to delete t where t is of the type T* ... (by aquaz)
Getting Wrong answer ?!?!
 
I believe my solution is correct , but dont't know why the site says that my answer is wrong , maybe you can help . Here goes the question :- Problem 2: The Le...
[14 replies] Last: Oh , i got it , what i was doing was not what was asked at all ! Than... (by Maggi Iggam)
New thread created in class problems
 
Having problems trying to figure this out. New to multithread programming. class Game { HANDLE hcol ; unsigned int WINAPI find(void *); int threadhand...
[4 replies] Last: square temp - OMFG! (by Burz666)
by Nonlin
Wont't ask for userinput
 
Also I think certain variables aren't being initialized as well mainly 'b'. #include "stdafx.h" #include <iostream> #include <cmath> #include<iomanip> using...
[2 replies] Last: lol thanks so much. Yeah I meant that don't know why I multiplied them... (by Nonlin)
C++ Multilingual Programming
 
Hello everybody, I have always wondered this. How possible is it to combine code written in Java with code written in C++? Is it possible to make a class in...
[3 replies] Last: For JNI, you just need a Java SDK. Which I think is usually called a J... (by JLBorges)
How do I define the "<" operator for list iterators?
 
I'm trying to make a map of list iterators and I have discovered that that requires the < operator defined. I intend to have it compare the address of the cont...
[9 replies] Last: You need to define the variable with a static storage duration (put th... (by JLBorges)
by Aquila
Returning the minimum of a vector
 
Hello all. I have the two functions below and their corresponding main function. Function 1: int maxofVec(int myarr ) { size_t len=sizeof(myarr)...
[2 replies] Last: Thank you and well said @shacktar. (by Aquila)
Extracting Data From Web Page
 
I have a program with 6 variables (the data type of each is "float"). The value of these variables is entered by the user. However, I would like to extract th...
[2 replies] Last: Thanks, but I'm not sure what link to follow on the page you provided.... (by Brandon Lashmet)
prime numbers
 
I want to create a program to decide whether is number is prime or not, and i tried with this code, but my program does not seem to go into the while loop and c...
[3 replies] Last: int main(){ bool is_prime=true; int num; cin >> num; for (i... (by exiledAussie)
C++ Question... Storing data in a .txt?
 
Hello everyone! I am creating a Money Management program in C++, and I have a question. I have: int AccountValue; Now, currently AccountValue is changed ...
[2 replies] Last: Also, use code tags. (by xander333)
An unhandled exception of type 'System.NullReferenceException' occurred in .exe
 
Hi guys, I have a little problem with my program. I ran the debugging and when I clicked on a button, I get an unhandled exception error of System.NullRefere...
[no replies]
error C2079: ... uses undefined struct ...
 
Long code short: class Creature { Creature(/*...*/) {} }; struct Enemy : public Creature { Enemy(/*...*/) : Creature(/*...*/) } class Comb...
[7 replies] Last: I dont' see it directly, but I'm willing to bet you have a circular in... (by Disch)
Small problem in explaining a line
 
Hi people, I wish to ask how would you comment such line. What I was going to right was that it is defining a name for the text file. Which is the reason I have...
[3 replies] Last: or it is just the semi-colin? (by orangeapple)
can anyone help me Removing letters from Alphabet, depending on which letter is entered.
 
Hi people, I have the alphabet which has 26 letters in a string and I wish to eliminate the letters one by one, by entering the letter I choose to press from...
[5 replies] Last: Hi people, thanks for your prompt replies. You were so helpful. Thanks... (by orangeapple)
Pointers issue here , hope someone can help
 
Hi , I have a pointer issue here , cant figure it out . int * readFile(){ int* array1 ; int arraysize; int i=0; ifstream myfile ("input.txt"); ...
[11 replies] Last: blue , thanks for that , i will look into it . hamsterman , thanks fo... (by aymank1985)
Templates & Inheritance - Danger of Ambigiousness?
 
Hi, folks! I was programming & eventually ran into a situation, which isn't very self-explanatory for me. Allow me to demonstrate: template<class T> class Fo...
[2 replies] Last: Wow, simple problems have simple solutions. Thank you, Peter87 ! You... (by Henri Korpela)
January 2012 Pages: 1... 45678... 36
  Archived months: [dec2011] [feb2012]

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