Forum: C++ May 22nd, 2008 |
| Replies: 2 Views: 787 1. I wonder why things work without linking to /usr/local/sesam/lib/libssv.so if you need it.
And if links without it I wonder why you need it.
2. Compare the size/timestamp of your mate's lib and... |
Forum: C++ Jul 2nd, 2007 |
| Replies: 10 Views: 4,660 Seems like someone asked the question, some else read read the answers and followed up with more question and finally someone understood all and thanked. :)
If solved mark the thread as solved.. |
Forum: C++ Jun 28th, 2007 |
| Replies: 10 Views: 4,660 Just one addition, in case of passing by pointer you would be dereferencing the pointer to pointer everytime you use it. Although compilers may optimize it. A reference works as an alias. |
Forum: C++ Jun 27th, 2007 |
| Replies: 10 Views: 4,660 Or of course you can pass it by C++ reference like:
void foo( char *& ptr)
{
ptr = new char[255];
}
int mian()
{
char *ptr = 0;
foo( ptr ); |
Forum: C++ Jun 26th, 2007 |
| Replies: 18 Views: 2,185 See now we know what you don't know.. :)
See this link (http://www.cplusplus.com/doc/tutorial/arrays.html) to learn teh abt arrays in C++. It tells you:
- What is an array?
- How create an array ?... |
Forum: C++ Jun 26th, 2007 |
| Replies: 10 Views: 1,677 Read-up the basics of arrays, function, function parameters.. <<= That's the direction ! |
Forum: C++ Jun 26th, 2007 |
| Replies: 10 Views: 1,677 >> I'm not asking for actual source, I just want to be pointed in the right direction
That's good to know. Understandably the code you've written would be a good indication of which direction you're... |
Forum: C++ Jun 26th, 2007 |
| Replies: 2 Views: 835 Line 15: Reading from cin, read from "file".
Line 18: This would always set charsPerLine to 0. (12/100) would evaluate to 0. Make it (12.0/100.0)
Line 23-24: Not clear what are you trying to do.... |
Forum: C++ Jun 26th, 2007 |
| Replies: 10 Views: 1,677 Read-up the basics of arrays, function, function parameters.. then write a program and ask for help.. |
Forum: C++ Jun 26th, 2007 |
| Replies: 18 Views: 2,185 If you don't know C++ well enough to even give it a try, you should just step back and learn the basics, give this problem a try and come back if you have some issues. Because there is no way someone... |
Forum: C++ Jun 25th, 2007 |
| Replies: 18 Views: 2,185 >> Anyone can do this in C++
Yeah ! |
Forum: C++ Jun 21st, 2007 |
| Replies: 9 Views: 3,104 Use MS Visual C++ (get Visual Studio).. you can find lotsa online tutorials for that.. |
Forum: C++ Jun 20th, 2007 |
| Replies: 4 Views: 3,925 Look at the call stack and see which d'tor (destructor) is being called, that should tell you where the problem is.. |
Forum: C++ Jun 19th, 2007 |
| Replies: 5 Views: 1,848 In windows if you have depends.exe you can right click on any exe file and should be able see an option called Show Dependencies.. Check it out, you'll know more abt dlls.
In Unix it's ldd command... |
Forum: C++ Jun 19th, 2007 |
| Replies: 5 Views: 1,848 A dll is not a process.. :)
May be the following will help:
- Once you've written your C/C++ code, you will compile it and then link it. Once you do this you will have an executable file (.exe on... |
Forum: C++ Jun 15th, 2007 |
| Replies: 13 Views: 2,199 Consider following the coding practice:
When you compare a const with a non-const for equality put const on LHS instead of RHS.
E.g.
//instead of this:
if ( start == 0 )
//do this:
if ( 0 ==... |
Forum: C++ Jun 14th, 2007 |
| Replies: 7 Views: 1,532 You are right. That's true AFAIK. :)
But also a static variables is always guaranteed to be initialized.
Also there is a clear difference between basic and non basic types. For a non-basic type the... |
Forum: C++ Jun 14th, 2007 |
| Replies: 7 Views: 1,532 Think that answers the question adequately.
Just to be clearer.. the difference between initialization and assignment is:
1. Initialization is done at the time of (or along with) creation of the... |
Forum: C++ Jun 14th, 2007 |
| Replies: 4 Views: 2,275 Can't find the decl of IDI_APPLICATION. |
Forum: C++ Jun 13th, 2007 |
| Replies: 4 Views: 2,275 Can you post declaration/definition of IDI_APPLICATION ? |
Forum: C++ Jun 8th, 2007 |
| Replies: 16 Views: 29,764 Just wondering that after #including vector/list etc, why are you using C-style array for this? Use C++ array (i.e. vector) instead, life is so much more easy.
#include <iostream>
#include <list>... |
Forum: C++ May 22nd, 2007 |
| Replies: 24 Views: 11,288 Surprising Salem didn't comment on this.. :)
[PS: those wondering why, see his icon/avatar] |
Forum: C++ May 21st, 2007 |
| Replies: 8 Views: 1,751 Probably to learn iterators. But otherwise vector being the C++ array one should use the subscript operator for accessing rather than iterator. It's faster. |
Forum: C++ Apr 16th, 2007 |
| Replies: 31 Views: 9,855 There are a few problems with the existing code itself:
1. Requirement says "void getScore()-should ask the user for a test score, store it in a reference parameter variable,"
=> This is not done.... |
Forum: C++ Apr 3rd, 2007 |
| Replies: 5 Views: 13,541 First the code won't compile due to This line:
=> char name[rows][columns];
Have a look at this (http://www.daniweb.com/code/snippet61.html) and this (http://www.daniweb.com/code/snippet197.html). |
Forum: C++ Apr 3rd, 2007 |
| Replies: 16 Views: 2,793 What was meant is there is no code that can generate 100x4 different seeds (which is what I did using Sleep(1)).
Anyway, it's actually not needed to generate 400 unique seeds like AD mentioned above... |
Forum: C++ Apr 2nd, 2007 |
| Replies: 16 Views: 2,793 It does if you use time(0) as seed for srand().
The problem is that you need to come up with 100 different random series with a single call to your program. (not running it multiple times).
Issue... |
Forum: C++ Mar 31st, 2007 |
| Replies: 17 Views: 3,239 |
Forum: C++ Mar 31st, 2007 |
| Replies: 16 Views: 2,793 There are other problems..
"Generate 100x4 unique arrays" even rand() won't exactly be rand() if you have a fast enough machine..
Here is one way:
void fill_array( int* arr, const int len,... |
Forum: C++ Mar 31st, 2007 |
| Replies: 17 Views: 3,239 It surely is UNICODE problem like Salem mentioned, search msdn.microsoft.com to find out how to write UNICODE compatible programs and what are the relevant project settings. You'll learn how to... |
Forum: C++ Mar 27th, 2007 |
| Replies: 10 Views: 2,057 Yes. Copy paste err..
So now I know you've understood for sure.. :) |
Forum: C++ Mar 23rd, 2007 |
| Replies: 10 Views: 2,057 Correction for comment in get_good()
/*
1 & X = X (where X = 0 or 1)
0 & X = 0 (where X = 0 or 1)
0x00 = 00000000
0x08 = 00001000
0x00 & 0x08 = 00000000 |
Forum: C++ Mar 22nd, 2007 |
| Replies: 2 Views: 1,094 Something more than "This code wont run at all right now" would be helpful. :)
I don't see why you would want to keep resizeing your vector. It's simply not needed to start with. I would suggest... |
Forum: C++ Mar 22nd, 2007 |
| Replies: 5 Views: 4,848 1. I didn't know that binary searches work on un-sorted list.
2. For the last if thing not working I think it's a flushing problem try this:
if (arra[mid]!=num)
//NOTE THE EXTRA flush AT... |
Forum: C++ Mar 22nd, 2007 |
| Replies: 10 Views: 2,057 It's hard to explain in precisely the given code. I need to know types and values of AFE_REG_FLAG_CDR and AFE_REG_FLAG_MSR. Also what're all these flags used for?
In general may be some example... |
Forum: C++ Mar 22nd, 2007 |
| Replies: 10 Views: 2,057 Did you read the articles I gave links to.. ? |
Forum: C++ Mar 22nd, 2007 |
| Replies: 10 Views: 2,057 I feel you've got something mixed up in copying these 2 lines
#define FLAG_CDR 0*01
#define FLAG_MSR 0*01
they should probably look somethig like:
#define FLAG_CDR 0x01
#define FLAG_MSR... |
Forum: C++ Mar 22nd, 2007 |
| Replies: 13 Views: 2,698 Here it's updated.. (See comments in code)
/*****************************************************
* COSC 230 - Structured Programming
* Chapter 6: Programming Exercise 7
* Mar. 20, 2007
*
*... |
Forum: C++ Mar 21st, 2007 |
| Replies: 13 Views: 2,698 I think the error "error C2664: 'estimatedPopulation' : cannot convert parameter 1 from 'int (__cdecl *)(int,int)' to 'int'" is clear enough though.. just look at the first param.. |
Forum: C++ Mar 21st, 2007 |
| Replies: 13 Views: 2,698 Line 27 and 28:
x = growthRate( birthRate , deathRate ) ;
population = estimatedPopulation ( growthRate , cPopulation, n ) ;
SHould either be:
x = growthRate( birthRate , deathRate ) ;... |