General C++ Programming - October 2010 (Page 9)

How to define the end of line in loop?
 
I have a text file with several line, I divide each line in to different string in to a if loop. But the problem is the code is only identifying the end of file...
[1 reply] : I'd say, open your file as an std::ifstream, and use std::getline, whi... (by bartoli)
"Value" of Assignment
 
This code compiles without warnings: int i; bool b = (!(i = 42)); The variable b is assigned true if i is assigned 0, and false otherwise, because of...
[4 replies] Last: It's not an error, it's a warning. Do what Athar said. Disable it (n... (by firedraco)
by ArtyL
Calling Member Functions within Member Functions
 
So, the project I'm working on is a few thousands lines, so I'm going to use a very bare-bones example to illustrate the problem I'm having. In my header for...
[3 replies] Last: Ugh. I just realized what I did wrong. Thanks anyway. :> (by ArtyL)
Writing my own math library from scratch
 
I was wondering, is the time required worth the experience-gain to write your own math library from scratch? One thing I challenged myself to is to at least mak...
[10 replies] Last: Sorry I haven't checked for quite a while, but I have to say... WOWWWW... (by fruitloop2222)
segmentation fault
 
hi all, i am having a segmentation fault while calling a class function. can you please advise me where i do wrong. thank you in advance. class funct...
[5 replies] Last: hi JoR you are right! istcmsApp don't point to the right address. ... (by pathfino)
Game development - Efficient saving system?
 
I'm currently making a game with C++, DirectX 9 but I need help with the Saving and Loading features. My original plan for a saving system would be to export...
[2 replies] Last: I would suggest binary as Athar said but would suggest xor-ing the out... (by sargon94)
pointer to template function problem
 
Hello, I have a class named Thread in which I have this functions: void Start( void(*workerFunction)() ) { struct Info { void(*workerFunc...
[4 replies] Last: Doesn't really change anything here. I found the problem though. Fo... (by magnificence7)
Pointer to an array definition can not be compiled
 
I can not compile the following code, and I cannot figure out why. char* charArray ; strcpy(charArray ,"wn"); strcpy(charArray ,"chair"); strcpy(cha...
[3 replies] Last: I don't have any syntax error before this code, but yet after I wrote ... (by Ana Developer)
by firix
static members problems
 
hi Define two classes, each with a s t a t i c member, so that the construction of each static member involves a reference to the other. Where might such const...
[no replies]
I work on a c++ project in my course and I can not do Vector erase
 
I write our records in a text file and read them in a vector and I should erase a specific data in them and write this vector to text file this new vecto...
[4 replies] Last: I had this issue a few weeks ago, it worked with xcode, but not window... (by ericeps)
by rej3kt
Quick basic classes error
 
I'm understanding classes alot better than my last post but I can't seem to find where this error is originating from: /home/rej3kt/Desktop/car_class/car proje...
[16 replies] Last: You're welcome. The difference is that headers such as iostream.h are ... (by filipe)
Disambigious array and pointer structures
 
Hi, How can I find detailed examples and information about differences between structures like bellow: 1. int (*a) 1D array of int * 2. int *a ...
[1 reply] : go thru "deep C secrets" by peter van der linden. (by rahulroot)
streaming url
 
I have a question. How would I stream in a the url of a webpage? I'm trying to get take in the webpages source and save it as a string. Any ideas?
[no replies]
Indexed List - Criticism Required
 
Hello, for the framework I've been making I have need of an index oriented list that must be very fast in both linear and indexed look-ups. I've made this clas...
[8 replies] Last: If you really need O(1) indexed lookups and fast iteration over the wh... (by xorebxebx)
why this programme fail to compile
 
Hi all: i encounter this somewhat awkward define directive and could not figure out how to resolve this,please help me. #include <stdio.h> #include <asse...
[1 reply] : 2 problems: 1) you probalby should be casting to const unsigned c... (by Disch)
GUI Programming
 
Lately I got very interested in GUI programming. I download Qt Creator and dived in head first. I was able to create a few apps and useless things. But now I'm ...
[16 replies] Last: I don't understand people's comments about Qt not being like C++? I us... (by Pax)
how to get value from a register(get a reference with register address)
 
I had designed the following code to practice my c++ skill #include<iostream> using namespace std; class classA { private: ...
[2 replies] Last: Your conclude seems well,an reference must be related to a real alloca... (by gelenbertang)
Precompiler replacements
 
Hello, I am facing the following situation. In my code at a point I need to declare a std::wstring and compare it with a text "MessageBox" read from a file. ...
[2 replies] Last: Sorry but i already use std::wstring (was writen false). The code i... (by trfillos)
coordinate compression/graph reduction
 
Hello. I'm trying to find information about how to reduce/compress a graph. The reason I want to do this is that the graph has potential to become quite large...
[7 replies] Last: Thanks everyone! I think I'm going to go with ne555's solution. It i... (by keepjumpin)
by RC325
Table Class <template> question
 
Here is a Table Class template <class elementType> class Table { public: Table( int = 10, int = 10 ); // default constructor ...
[12 replies] Last: The operator==() implementation needs a second look, as well. It is m... (by moorecm)
October 2010 Pages: 1... 7891011... 23
  Archived months: [sep2010] [nov2010]

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