Search:
Type: Posts; User: Zlatomir
Search:
Search took 0.03 seconds.
-
December 30th, 2012, 09:27 AM
I updated the function definition and return value (this is because i didn't understood what are you going to return) and you were using cin in the function to read values into some parameters that...
-
December 22nd, 2012, 06:21 AM
Move the definition of Initialize into the header (that contains the declaration of GetValue<T>) and it should work, see this faq for more information:...
-
December 21st, 2012, 05:56 PM
The only issue i see in the code you posted is that GetValue<T>::Initialize() is not public (or protected) but that shouldn't cause an undefined error, so are you using some "friend-based" mechanism...
-
November 24th, 2012, 05:22 AM
You are getting the wrong year because tm struct has a particular year representation see the "year format" here: http://www.cplusplus.com/reference/ctime/tm/
And the random values most likely...
-
March 19th, 2011, 05:03 PM
@GCDEF agree with you that it shouldn't, but it can and there can be some very tricky situations regarding this fact.
I talk about for example uninitialized bool which can return false if compared...
-
March 19th, 2011, 04:42 PM
No, that is what i tried to explain to you, a bool can store other values, since it is not a single bit (it's 8)
You need to double the \ to appear:
cout << "Hello \\n";
-
March 19th, 2011, 04:25 PM
Pointers just store the address of a variable, the variable itself can be allocated on the heap or on the stack (if it's allocated on the heap you need to call delete on the pointer to free the...
-
March 19th, 2011, 04:15 PM
An bool in c++ is 1 byte (8 bits) if you store the value 7 in that byte and compare it with the value 1 (true) it will go on the false branch (because those values are not equal) even if they both...
-
March 19th, 2011, 07:37 AM
You can create object on the stack and pass parameters to them, there is no problem there:
QString stringName("Whatever string you like");
The only "problem" is when you want the default...
-
March 15th, 2011, 03:47 PM
Just a little suggestion, the exercise sample arrays suggest your class should be a template, so i say you start with a template class from the beginning, so the code should look something like:
...
-
March 15th, 2011, 03:26 PM
It's a naming convention: C++ standard libraries header files don't have the .h extension and also the C standard libraries are named with c prefix and without extension (usually old names like...
-
March 6th, 2011, 06:49 PM
You need to debug the code and see what selection(files) returns.
And the difference between the do...while and while is in principle that do..while always executes the do code block at least once...
-
November 4th, 2010, 05:55 PM
The code is not complete, not the error message (you didn't told us the variable name)
But most likely the error is about this miss-match:
class Numbers //here you have the 's'
{
public:...
-
August 6th, 2010, 03:26 PM
I don't think that you should start with the reading quite big projects source code, first finish the book, do all the exercises from the book (maybe get other more advanced book) and when you are...
-
August 1st, 2010, 04:18 AM
The original problem was "working" Qt...
I really recommend to download (and install) the Qt SDK for Windows, witch comes bundled with MingW compiler (and make tool) with qmake (tool specific to Qt...
-
I'm pretty sure that you will not get that "feature", not even in c++2x (or whatever the next standard will be called)
But if you point a problem where you need that, we will tell you (probably...
-
You can do "specialization" for vector<T> something like in this: (just a simple example, but it must compile ;) )
#include <iostream>
#include <vector>
template <typename T>
class Test{...
-
Does the number or types of arguments change?
If they do, or your _LOG_FUNCTION_ will be generic, you should search for: "perfect forwarding", it's from c++0x, so not many compilers will have this...
-
The data members are constructed in order of declaration in the class definition, so j first and i second, and the syntax: A():i(func1()),j(func2()) does initialization in the same time with...
-
int factorial (int n) // function that returns an int value and takes one int parameter
{
int fact = 1;
for (int i=1; i<=n;i++) { // this is a for-loop, this execute the code for n times
...
-
int factorial (int n)
{
int fact = 1;
for (int i=1; i<=n;i++)
fact = fact * i;
return fact;
}
Here is a simple function for calculating factorial, if there is something that you don't...
-
Yes, it is possible, that won't be an actual build-in integer (because for example: 128bit integer you create a class that has 4 32bit int members and operate with that) but with operator overloading...
-
I'm pretty sure that another compiler is the "solution"
dev c++ latest release is from 5 years ago, that's is a long period, not to mention c++0x, latest compilers (at least latest releases of gcc...
-
The commented line should be: i am passing constructor's arguments
I'm sure that is called: "Passing constructor's arguments" (or something similar), that's not a actual function call of the...
-
If you use any virtual function do not forget to use virtual destructor.
|
Click Here to Expand Forum to Full Width
|