Search Results

Showing results 1 to 40 of 121
Search took 0.02 seconds.
Search: Posts Made By: ArkM ; Forum: C++ and child forums
Forum: C++ Jun 16th, 2009
Replies: 9
Views: 502
Posted By ArkM
1. About C4716: didn't you know that double F_Ite() function must return double type value? And where is return anything-of-double_type in the function body? It's your code, you have wrote double...
Forum: C++ Jun 14th, 2009
Replies: 17
Views: 1,022
Posted By ArkM
The wittingly wrong statement in OP code is delete buffer; - must be delete[]buffer;. Yet another defect: insufficient error check-up.

long GetFileSize(ifstream &file)
{
static const...
Forum: C++ Jun 12th, 2009
Replies: 4
Views: 310
Posted By ArkM
Are you sure that your method is not efficient?
Why?..
What's your efficiency criterion?
Forum: C++ Jun 12th, 2009
Replies: 6
Views: 352
Posted By ArkM
Of course, all possible in C++ ;)
That's an improvisation:

/// suite.h (class Suite definition)
class Suite
{
public:
Suite() {}
Suite(const Suite& suit):value(suit.value) {}
...
Forum: C++ Jun 11th, 2009
Replies: 6
Solved: Return pointer
Views: 481
Posted By ArkM
>I want the minimal pointer because it is the left most node for my tree.
The leftmost node in the tree is not the same as the minimal pointer!
Moreover, a pointer value does not bear a relation to...
Forum: C++ Jun 9th, 2009
Replies: 7
Views: 405
Posted By ArkM
>i checked for Nov and for Dec
Hmm... For December the code returns a wrong answer months(0)...
Well, the right answer is:

currentMonth % 12 + 1

;)
Forum: C++ Jun 8th, 2009
Replies: 13
Views: 560
Posted By ArkM
Try to append LL suffix to long long constants.
Forum: C++ Jun 6th, 2009
Replies: 4
Views: 312
Posted By ArkM
for (int i = 0; i < 20; i++)
Forum: C++ Jun 5th, 2009
Replies: 2
Views: 257
Posted By ArkM
What's an excited title for help request: I don't know!!...
Next time try to invent more sensible phrase...

It's a well-known ;) fact that

lcm(a,b) = (a/gcd(a,b))*b

where gcd means greatest...
Forum: C++ Jun 1st, 2009
Replies: 4
Views: 306
Posted By ArkM
Step by step instruction:
1. Start Visual Studio
2. Select Help | Index
3. Type LNK2001 in Look For field
4. Click on LNK2001 list element
5. Read about LNK2001 error
6. Error correction:...
Forum: C++ Jun 1st, 2009
Replies: 18
Views: 890
Posted By ArkM
>I am talking about the programming interface ArkM, it is drag and drop just like VB
>I'm out of this thread, tired of being treated like a dumbass.
I hope now you will have a time to read Qt...
Forum: C++ May 31st, 2009
Replies: 6
Views: 356
Posted By ArkM
Didn't you familiar with logical not operator?

if (!*fileName)
// or
if (fileName[0] == '\0')
// or
if (strlen(fileName) == 0)

By the way, fileName == "" is equal to false in all cases....
Forum: C++ May 31st, 2009
Replies: 3
Views: 313
Posted By ArkM
It's legal to compare any pointer value with null pointer or any others pointer values of the same type.
Better post your code fragment with segmentation fault. It's annoying to download the whole...
Forum: C++ May 30th, 2009
Replies: 10
Views: 589
Posted By ArkM
I have found this exotic Number_1_C... panopticon at Ohio state university site. It looks like an attempt to convert the C++ language to an incomprehensible slang for dedicated persons. As far as I...
Forum: C++ May 30th, 2009
Replies: 4
Views: 464
Posted By ArkM
You can deallocate dynamically allocated memory here, there and everywhere:

int main()
{
al = new Vertex*[numLocations];
...
delete [] al; // al is visible
...
// or
f(al); //...
Forum: C++ May 29th, 2009
Replies: 3
Views: 512
Posted By ArkM
Yes, old good (or most likely bad) VC++ 6.0 can't compile String member template from std_lib_facilities.h. However why #include "iostream" instead of <iostream>?

Better try to download and...
Forum: C++ May 29th, 2009
Replies: 6
Views: 215
Posted By ArkM
I was trying to understand what's the ASCII value of a string of text (about 10 seconds or even more)... Alas... Can you explain what is it?

Now I see why you cannot seem to figure out how to...
Forum: C++ May 29th, 2009
Replies: 16
Views: 651
Posted By ArkM
iamthwee.thank(you).for(post(number(2)));
;)
Forum: C++ May 26th, 2009
Replies: 12
Views: 517
Posted By ArkM
tux4life, don't torment the unhappy C++ programmer, tell him/her about while(f>>i) construct ;)
Forum: C++ May 26th, 2009
Replies: 3
Views: 276
Posted By ArkM
cout << r[0] << r[1] or cout << r.substr(0,2)
;)
Forum: C++ May 24th, 2009
Replies: 15
Views: 617
Posted By ArkM
Please, post your code with code tag:

source

Read this forum announcement: http://www.daniweb.com/forums/announcement8-3.html
Forum: C++ May 18th, 2009
Replies: 4
Views: 533
Posted By ArkM
Try winbgim or winBGI libraries - BGI for Windows (search Google).
Regrettably (or fortunately), I have never used these libraries...
Forum: C++ May 18th, 2009
Replies: 10
Solved: No Console
Views: 526
Posted By ArkM
Place this function into the separate .cpp file:

void ShowText(const char* filename)
{
::ShellExecuteA(::GetDesktopWindow(),
"open",
"notepad.exe",
filename,
...
Forum: C++ May 17th, 2009
Replies: 27
Views: 2,044
Posted By ArkM
What's a nightmare! Have you ever seen a simplest book on programming languages syntax?..

>an expression is an assignment to a variable like...

What is an expression in C++:

It's NOT an...
Forum: C++ May 16th, 2009
Replies: 5
Views: 300
Posted By ArkM
Use pointers:

class A // Better use capitalized names for your classes
{
public: // Better place public interface first
A():inFile(0),report(0) {}
void setinput(std::ifstream& in) { inFile...
Forum: C++ May 16th, 2009
Replies: 8
Views: 1,038
Posted By ArkM
Read this: http://www.ddj.com/cpp/184401305
Forum: C++ May 14th, 2009
Replies: 5
Views: 398
Posted By ArkM
The answer: use anonymous namespace...

using std::cout;

class A // External linkage name
{
public:
void f() { cout << "::A:f()\n"; }
};
namespace { // Internal linkage area:
Forum: C++ May 14th, 2009
Replies: 2
Views: 677
Posted By ArkM
>I looked on google ...
After ~15 seconds:
http://www.codeproject.com/KB/recipes/csha1.aspx
http://www.packetizer.com/security/sha1/
What's a problem?
Forum: C++ May 11th, 2009
Replies: 5
Views: 296
Posted By ArkM
bool conjugated(const std::string& s1, const std::string& s2)
{
return s1.size() == s2.size() &&
(s1+ s1).find(s2) != std::string::npos;
}

;)
Forum: C++ May 10th, 2009
Replies: 22
Views: 908
Posted By ArkM
Other failed tests:

f("\""); // Strip me!


ch = '\"'; // Strip me!

Probably, this is too much!(?) :

#if 0
Forum: C++ May 9th, 2009
Replies: 6
Views: 407
Posted By ArkM
Of course, operator ~. What's a shame :( Sorry.
Forum: C++ May 3rd, 2009
Replies: 39
Views: 1,313
Posted By ArkM
You have used pointers in a[i] construct because a[i] <=> *((a)+(i)) by the language definition. You have used pointers in sort(int a[],... construct because an array argument converts to the pointer...
Forum: C++ May 3rd, 2009
Replies: 6
Views: 652
Posted By ArkM
Take into account that

123456 * 654321 * 80779853 == 6525384681074833728

but std::numeric_limits<long>::max() is equal to 2147483647 on 32-bit processors (integer overflow is not detected)....
Forum: C++ May 1st, 2009
Replies: 19
Views: 824
Posted By ArkM
/// fast int test (except possible overflow)
bool isInt(const std::string& s)
{
static const size_t npos = std::string::npos;
static const std::string digits("0123456789");
size_t...
Forum: C++ Apr 28th, 2009
Replies: 35
Views: 2,042
Posted By ArkM
>...then you're working for the NSA...
That's it! (see my the 1st post in the thread above ;).

"Unpredictable" or "non-reproducible" sequences (it's not the same as "random") are used for...
Forum: C++ Apr 24th, 2009
Replies: 8
Views: 573
Posted By ArkM
Of course, it's impossible to overload operator + for char* type ;)
It's overloaded for std::string:

std::string std::string::operator+(const char*) const;

;)
Forum: C++ Apr 24th, 2009
Replies: 18
Views: 1,114
Posted By ArkM
Regrettably the OP question (and all the thread ;)) is a product of a misunderstanding of an array semantics in C++ (and C). If we have an array which is defined as int x[100] = {1,0,3}; then we have...
Forum: C++ Apr 23rd, 2009
Replies: 7
Views: 578
Posted By ArkM
Output stream named infile... That's cool! ;)
Forum: C++ Apr 16th, 2009
Replies: 7
Views: 329
Posted By ArkM
About the second point. I think that error message printing on too low level is a very harmful practice. In that case we have a chance to get a bucket of messages on a single failure. Besides that...
Forum: C++ Apr 12th, 2009
Replies: 35
Views: 1,942
Posted By ArkM
;)

bool isEven(const char* number)
{
bool even = false;
if (number) {
if (*number == '-' || *number == '+')
number++;
if (*number) {
even =...
Showing results 1 to 40 of 121

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC