278 Posted Topics

Member Avatar for enkidu75

You first loop through i, and inside this for loop you loop through j. So the sequence will look like: i j output 0 0 "5a" 0 1 "5b" 0 2 "5c" 1 0 "5a" 1 1 "5b" 1 2 "5c" 2 0 "2a" 2 1 "2b" 2 2 "2c" …

Member Avatar for enkidu75
0
99
Member Avatar for hanvyj
Member Avatar for heezay

It does make sense, but your question is way too general. Based on you're post we have no idea how far you are... have you actually downloaded the information from the website already? Have you parsed it to get the individual items that you are interested in? etc. etc. So …

Member Avatar for thelamb
0
130
Member Avatar for Lukezzz

Are you sure this 'Chilkat' FTP library throws exceptions when something goes wrong? Maybe it is expecting you to check the return value of WriteFile etc.

Member Avatar for Lukezzz
0
244
Member Avatar for Allophyl

Probably because you didn't specify the namespace. nth_element is an std function so is only defined in the std namespace. U have some options: - Use std::nth_element - Put using std::nth_element; after including the header file - Put using namespace std; after including the header file (not a very sexy …

Member Avatar for Allophyl
0
557
Member Avatar for Lukezzz

There is a new 'type' of framework, called the .net Framework 4 Client .. something. It's much smaller because it doesn't include the server-side stuff that a client doesnt really need anyway. You can try to install this to see if it will work. I'm no .net developer so I …

Member Avatar for thelamb
0
152
Member Avatar for lmbdx

Why would you want to keep the console application seperate? There aren't (m)any real world applications that spawn a new process to do some work and only use the GUI for configuration. So just create one GUI project, and put the code from the console application in there... You will …

Member Avatar for lmbdx
0
594
Member Avatar for WASDted

@Chris : That's not really a C++ problem, a programmer should not use a reference to change a variable in a function, if the variable is to be changed he should use a pointer. A reference can be used to 'speed up' functions that take large data structures as arguments, …

Member Avatar for AuburnMathTutor
2
715
Member Avatar for epicasian

vc_attributes is part of some CodeAnalysis 'framework' by Microsoft( [url]http://msdn.microsoft.com/en-us/library/ms182036(VS.90).aspx[/url] ). Are you using someone else's code or a 3rd party library ? Or is it your intention to use this source code analysis/annotation ? I develop for Linux and Windows so I use Code::Blocks (there is a new version …

Member Avatar for mike_2000_17
0
165
Member Avatar for angelinrajeesha

A class that has _any_ pure virtual function cannot be instantiated directly. So not only complete Abstract classes... [code=cpp] class myBase { virtual void pureVirtual() = 0; void normal() { }; }; class myClass : public myBase { void pureVirtual() { } }; int main() { myBase base(); // Error, …

Member Avatar for angelinrajeesha
0
622
Member Avatar for ThrasherK

What your teacher said is true to some extent, a lot of programming techniques are applicable to multiple languages. This does not mean that every language is equally easy to learn. C and C++ are lower languages than languages like VB, java etc. generally this also means that are harder …

Member Avatar for Fbody
0
677
Member Avatar for thilangane

Ok first of all: Why are you passing this list as pointer and not a const&? You are not modifying the passed list in any way... If you insist on using a pointer to pass it, we need to see how you're calling this function to be able to see …

Member Avatar for thilangane
0
234
Member Avatar for kneel

First of all, use code tags to paste code... So let's look at your error, it is complaining that it cannot convert an int* to an int. And the error occurs in getValue. getValue is declared to return an 'int', and in the function you return 'value' which is declared …

Member Avatar for Fbody
0
125
Member Avatar for deanus

Any compiler will tell you that's wrong. When you allocate an array statically(as oppose to dynamically) the size of the array _must_ be available at compile time. In your example, maxElements is a variable so the compiler has no idea if it's going to change at runtime. So you have …

Member Avatar for alaukik
0
88
Member Avatar for nshuti

Read this: [url]http://www.daniweb.com/forums/thread296671.html[/url]

Member Avatar for sfuo
0
85
Member Avatar for ttx336

VisualStudio has a free edition (called the Express edition). It has some downsides though if you plan to release your programs to the public(requires microsoft c++ redistributables to be installed on the target system, but it mostly is already). I've used VS when I started, but have since moved to …

Member Avatar for sfuo
0
146
Member Avatar for Brian Perrigan

It's not outputting the address of the values.. an address looks like 0x00401000 and the individual elements of the string wouldn't just take 1 byte (and also.. '88' doesn't really follow 57 :P). Basically, you have stumbled upon something called 'implicit conversion'. When you access isbn[ i ] the datatype …

Member Avatar for Brian Perrigan
0
151
Member Avatar for VBNick

Are you maybe executing a release build outside of VS, and inside a debug build? In that case there could be an assertation in the function. The documentation does not state that the handle must be valid... it does state that if the handle is closed while the wait is …

Member Avatar for VBNick
0
2K
Member Avatar for vttuning

CNoFila is a class... and you are comparing it with operator !=. But how can it compare your class with NULL? This comparison only makes sense if you implement operator!= for you CNoFila(Google for 'Operator Overloading') or if 'Actual' is a pointer to CNoFila (a pointer can be NULL).

Member Avatar for vttuning
0
133
Member Avatar for s2xcracker

How do you think it should be done? What have you tried yourself? Just saying it is difficult for you gives us no indication what you're having trouble with understanding.

Member Avatar for s2xcracker
0
72
Member Avatar for maira74

The question is to assign a char, to an int variable. Meaning you will need to declare an int: [code=cpp] int myInt; [/code] And then assign a char to it: [code=cpp] myInt = 'c'; // or: char myChar = 'c'; myInt = myChar; [/code] The point of this assignment is …

Member Avatar for p@rse
0
122
Member Avatar for sethamus

As far as I can tell, in "(a14*pow(temp,(12-14))" the ( is unclosed. It's on the 5th line in your big calculation. It would help if you format this big calculation a little.. it doesn't matter if there are spaces or tabs around math operations... that way it would be much …

Member Avatar for wisaacs
0
223
Member Avatar for vlad44

I assume you are re-opening the same file because you first want to create it and then edit the existing file. There would be no problem if you don't re-open the file and just to seekp and put(c). What you want is of course possible with fstream, it would be …

Member Avatar for vlad44
0
113
Member Avatar for HAIDER69

Before expecting any comments from us, please show us what you have done yourself. Did you think about it atall? If yes.. what are your thoughts? If no... think about it first.

Member Avatar for HAIDER69
0
3K
Member Avatar for joshalb

Hmm, your method to search for the next 'available' pointer-'spot' is not very efficient. You are using C-style arrays... which is no necessarily wrong but what you're trying to do is much easier by using C++ vector's. You won't need the 'instanceExists' array then: [code=cpp] #include <vector> using std::vector; vector<baseObject*> …

Member Avatar for joshalb
0
152
Member Avatar for emcyroyale

[QUOTE] In all the programs that we have made, all the headers(#include <iostream>...etc) are in the top of the cpp file in the source folder.[I] Why is there a folder that is named header files then?[/I] [/QUOTE] Header files define prototypes of functions that are implemented either in a library …

Member Avatar for thelamb
0
223
Member Avatar for mloC

You can place the entire (nameless)struct's declaration in the class header. e.g.: [code=cpp] class myWrapper { struct { int houseNumber; } address; public: myWrapper() { address.houseNumber = 555; } // this is valid }; int main { No way to access address from here, apart from a public interface. } …

Member Avatar for mloC
0
114
Member Avatar for tundra010

Can I ask why you want to use dynamic memory allocation in this case? Rather than just using 'bool hasSetPages;' and forget about new/delete;

Member Avatar for thelamb
0
114
Member Avatar for findlay

So it does not say that it cannot find libboost_regex.so? In that case: does /usr/lib contain any other boost libraries? If I remember right.. (I've used this library a while ago) the regex lib depends on some other boost libraries that you need to link to aswell. Maybe post the …

Member Avatar for findlay
0
761
Member Avatar for Kanoisa

I've had the same 'problem' as you when I started (I'm also selftaught)... but I don't really understand what error handling has to do with it... but let me comment on that first: You created your own macro that in debug-mode prints some information about the error.. this is a …

Member Avatar for Bench
0
144
Member Avatar for mebob

If this is something that you commonly 'mess up', consider writing code like: if( true == myBoolean ) instead of if( myBoolean == true ). If in the first case you write if( true = myBoolean ) by accident, the compiler will start complaining (the same works with other conditional …

Member Avatar for thelamb
0
104
Member Avatar for bubacke

If I remember the C++ programming language book correctly the standard states that the second expression should not be evaluated if the first evaluates to false(would be pointless)... but maybe the OP's compiler doesn't follow this standard strictly.. or I am remembering wrong and it's not actually in the standard. …

Member Avatar for bubacke
0
132
Member Avatar for dhruv_arora

There are left over characters in the buffer after the first cin.getline(), the second cin.getline() is picking this up. Read this: [url]http://www.daniweb.com/forums/thread90228.html[/url]

Member Avatar for dhruv_arora
0
113
Member Avatar for Chosen13

[code=cpp] void Map::LoadMap(const std::string& filename) { std::ifstream file; if(!file.is_open()) { [/code] is_open() will _always_ return false, no matter what 'filename' you hand over to this LoadMap function. Think about what you're missing, how will ifstream 'know' which file to open?

Member Avatar for thelamb
0
248
Member Avatar for tkud

Post the header file you're including (if it's small) and how you include it... Could be a missing #endif, or a missing ; etc.

Member Avatar for tkud
0
91
Member Avatar for memstick

The [out,retval] looks like an annotation to me, but I have never seen it this way. What compiler do you use? If it is an annotation it is basically an aid for the compiler, or some code verification tool. For instance if you as programmer are to delete the returned …

Member Avatar for memstick
0
118
Member Avatar for nschessnerd

We'll need more information than this... generally ReadProcessMemory should not crash the target application of course, so it seems you're doing something 'wrong'... without knowing what exactly you're doing we're in the dark here ;). Try to down-size the code as much as possible while still crashing the target (e.g. …

Member Avatar for nschessnerd
0
232
Member Avatar for kcband

Read this: [url]http://www.daniweb.com/forums/thread90228.html[/url]

Member Avatar for thelamb
0
95
Member Avatar for fernandofranca

Let me get this straight.. the code you are currently posting (with the temp stringstream) is working, but if you write [code=cpp] arq_linha_part >> parm; [/code] It gives you an error? If so, then it should give you an error. The short answer is that std::string (the arq_linha_part variable) does …

Member Avatar for fernandofranca
0
158
Member Avatar for mattloto

I don't remember exactly, but some years ago I tried the same, and it was a downright pain in the ass to get it to work, so in the end I just went back to the microsoft C++ compiler... it will save you a lot of trouble. In any case …

Member Avatar for Ketsuekiame
0
280
Member Avatar for zoner7
Member Avatar for thelamb
0
105
Member Avatar for dchunt

It is impossible to say how much faster your code wil run, if any faster atall, if you 'use vectors or pointers'. Generally using vectors will even be slower than using raw pointers. I'm not sure how you expect to see a performance increase by using pointers... in certain areas …

Member Avatar for thelamb
0
1K
Member Avatar for mksakeesh
Member Avatar for thelamb
0
121
Member Avatar for shadowuy

No, Banfa is right. You are correct that the first element is located at index '0', and you know that there are in total 5 elements. 0 - first element 1 - second 2 - third 3 - fourth 4 - fifth (bingo, end of array) (5 - sixth, non-existing)

Member Avatar for thelamb
0
175
Member Avatar for romyboy2k9

It really makes sense what you're doing wrong... I think you basically wrote the code that sents newNode->x and then copy/pasted it, changing 'x' to 'y'. Look at the things that you are doing for _both_ x and y, and think about if it makes sense... Let me state it …

Member Avatar for thelamb
0
126
Member Avatar for fellixombc

The sockets you 'accept' are set to blocking, which means they can wait indefinitely until new data is ready to be recv'd. So if you are only sending 2 strings on that socket, the loop will stick there if there is no data to be read. I'm having trouble understanding …

Member Avatar for fellixombc
0
1K
Member Avatar for avarionist

A few things: Why is 'item' in the test class public? In your wrapper class you perform some operations twice: [code=cpp] string top(){ item.top(); return item.top(); } // Why not: string top(){ return item.top(); } [/code] Also, your push takes a string* as arugment, but it is not clear if …

Member Avatar for avarionist
0
123
Member Avatar for MATLAB2007

Why does it obviously not work if you copy just the executable? You'd mostly only need an installer when releasing a big project... if it's just some executable what would the installer do to make it working on the other's PC?

Member Avatar for Pynolathgeen
0
102
Member Avatar for hatzi8

By building the solution, it is already creating the exectutable(check your project settings for 'output directory'. Since you are building with the Express edition of Visual Studio, the 'C++ redistributables' need to be installed on any computer where u wish to run your executable(mostly it is).

Member Avatar for VernonDozier
0
85
Member Avatar for paraug99

The End.