Forum: C++ Mar 28th, 2009 |
| Replies: 8 Views: 770 That is not quite correct, see comments
int main(void)
{
/* Declare the '2D Array' */
char ** ptr = new char * [5];
ptr[0] = new char[20];
ptr[1] = new char[20];
ptr[2] =... |
Forum: C++ Mar 16th, 2009 |
| Replies: 17 Views: 1,325 Umm, maybe you misunderstood me (?). I was not trying to say that MSVC 6.0 cannot be used on Windows versions later than "Windows Server 2003".
Instead, I was trying to say that the "Windows... |
Forum: C++ Mar 16th, 2009 |
| Replies: 17 Views: 1,325 You might look at Using Visual C++ 2008 Express with the Windows SDK (http://blogs.msdn.com/windowssdk/archive/2008/02/22/using-visual-c-2008-express-with-the-windows-sdk-detailed-version.aspx) |
Forum: C++ Mar 10th, 2009 |
| Replies: 4 Views: 565 Read about When should my destructor be virtual? (http://www.parashift.com/c++-faq-lite/virtual-functions.html#faq-20.7) |
Forum: C++ Feb 27th, 2009 |
| Replies: 4 Views: 676 To get 'non-destructive writes', open the file specifying also the ios::in mode. |
Forum: C++ Feb 17th, 2009 |
| Replies: 12 Views: 3,127 Both the pFrom and pTo members need to be double-null terminated, see the
SHFILEOPSTRUCT Structure (http://msdn.microsoft.com/en-us/library/bb759795(VS.85).aspx) documentation. |
Forum: C++ Feb 4th, 2009 |
| Replies: 13 Views: 2,886 IsWindowVisible() (http://msdn.microsoft.com/en-us/library/ms633530(VS.85).aspx) might be useful. |
Forum: C++ Nov 7th, 2008 |
| Replies: 12 Views: 1,320 Well, by doing the following ...
...
background = load_image("background.bmp");
if(background == NULL)
{
// load_image() failed ...
cout << "load_image() failed, error: " <<... |
Forum: C++ Oct 27th, 2008 |
| Replies: 2 Views: 406 Try with these changes
//CUSTOMERDLL.H
#ifndef DllH
#define DllH
#include "customerForm.h"
extern TCustomerF* DllCustomer;... |
Forum: C++ Oct 21st, 2008 |
| Replies: 3 Views: 435 I think you are using a 32-bit toolset (VS Express) and trying to link with the 64-bit version of libmysql.lib.
The 32-bit version of libmysql.lib comes with those missing symbols, what you have is... |
Forum: C++ Sep 27th, 2008 |
| Replies: 7 Views: 657 You might try something like ...
#include <iostream>
using namespace std;
struct test
{
void myfunction()
{
cout << "myfunction()\n";
} |
Forum: C++ Aug 29th, 2008 |
| Replies: 7 Views: 1,651 Here is how you get items of a single (selected) row
TListItem * Item = ListView1->Selected;
if(Item)
{
AnsiString text = Item->Caption;
TStrings * subItems = Item->SubItems;
... |
Forum: C++ Aug 22nd, 2008 |
| Replies: 13 Views: 2,899 But really consider that presumably TurboC was released before most of the students posting here were even born. So, please do not advertise an antiquated/out dated tool for these students. (If... |
Forum: C++ Aug 21st, 2008 |
| Replies: 2 Views: 498 Your myFunc typedef does not match the DLL function's signature because you've omitted the calling convention from the typedef (by default, VC++ uses the _cdecl calling convention). So you need to... |
Forum: C++ Aug 16th, 2008 |
| Replies: 18 Views: 3,821 Go through the stored items in the Library's destructor and explicitly delete the items there. |
Forum: C++ Aug 11th, 2008 |
| Replies: 2 Views: 351 Since you have
printVector(vector<T> & x)
pass by reference ...
printVector( x ); |
Forum: C++ Aug 11th, 2008 |
| Replies: 9 Views: 1,163 One obvious little error ...
if( jump = true ) |
Forum: C++ Aug 8th, 2008 |
| Replies: 2 Views: 299 Dereferencing was actually missing ... i.e.
if( (*(visualEntity.begin() + i))->LOD == wantLOD){ |
Forum: C++ Aug 7th, 2008 |
| Replies: 17 Views: 1,625 No, the point is that the specific object that you have on the heap, is NOT stored into the list. Instead, the derefenced pointer which you supply to push_back(..) is only used to construct another... |
Forum: C++ Aug 6th, 2008 |
| Replies: 9 Views: 853 You are missing ...
bResult = DeviceIoControl(hDevice, // device to be queried
IOCTL_DISK_GET_DRIVE_GEOMETRY, // operation to perform
NULL, 0, // no... |
Forum: C++ Jul 23rd, 2008 |
| Replies: 42 Views: 3,098 Try not to use the goto, have you considered using break instead
for(int i=0; i<10; i++) {
if (i > 0)
break; // <- breaks out of the for loop ...
else
cout << i;
} |
Forum: C++ Jul 22nd, 2008 |
| Replies: 42 Views: 3,098 Futhermore, you have the variables the wrong way around, i.e. instead of
a >> strin;
use
strin >>a; |
Forum: C++ Jul 22nd, 2008 |
| Replies: 17 Views: 1,162 The code needs proper, consistent indentation. |
Forum: C++ Jul 15th, 2008 |
| Replies: 6 Views: 564 See e.g. here (http://www.parashift.com/c++-faq-lite/serialization.html) |
Forum: C Jul 15th, 2008 |
| Replies: 2 Views: 470 The function is malloc(), not maloc(). |
Forum: C++ Jul 10th, 2008 |
| Replies: 2 Views: 836 See e.g. RegQueryInfoKey() (http://msdn.microsoft.com/en-us/library/ms724902(VS.85).aspx) |
Forum: C++ Jul 8th, 2008 |
| Replies: 48 Views: 3,270 At least a couple of severe errors ...
...
payroll *employee[6], *report;
// here you call printreport() through an uninitialized/unallocated pointer,
// it is a big no-no ... |
Forum: C++ Jul 1st, 2008 |
| Replies: 11 Views: 1,079 For example the remove() function cannot be passed in a const string &, because the function modifies the argument. So you need to have ...
bool remove ( std::string & x ); |
Forum: C++ Jun 30th, 2008 |
| Replies: 7 Views: 5,777 Here is one way to trim leading whitespace
string test_string = " test_string";
string ws = " \t";
// lookup the position of the first non-whitespace char, if any
... |
Forum: C++ Jun 27th, 2008 |
| Replies: 11 Views: 1,168 Pick up the habbit of using e.g. the following compiler options -W -pedantic -Wall.
When you compile, work through the error/warning list until your program compiles cleanly.
Here is a guide... |
Forum: C++ Jun 26th, 2008 |
| Replies: 29 Views: 3,049 It appears that you are confused by the link ordinals in the .def files. If you take a look at the original .def file, there may be e.g a line like
LT360LIB_OpenLinkUSB @2 ;... |
Forum: C++ Jun 26th, 2008 |
| Replies: 29 Views: 3,049 Just occurred to me that probably you'll have to do some changes before using LIB.exe. Apparently the .DLL functions use __stdcall calling convention, so you'll have to modify each function so that... |
Forum: C++ Jun 20th, 2008 |
| Replies: 3 Views: 452 Yes, when you want to release that memory, 'delete' needs to be issued. |
Forum: C++ Jun 13th, 2008 |
| Replies: 9 Views: 816 Two simple examples, hopefully you'll get something figured out of those ...
class a
{
public:
a(string s1, string s2){}
};
class b : public a
{
public:
// default ctor |
Forum: C++ Jun 12th, 2008 |
| Replies: 17 Views: 1,638 Initialize outside the class i.e.
// outside your class ...
const HANDLE MultiReader::hReaderMutex = CreateMutex( NULL, TRUE, "ReaderMutex"); |
Forum: C Jun 11th, 2008 |
| Replies: 2 Views: 502 int myfunction(int argc, char *argv[]){
int i;
for(i=0;i<argc;i++)
unlink(argv[i]);
}
int main(){
int argc; // argc is not initialized to any value, what might be its value here ??... |
Forum: C++ Jun 10th, 2008 |
| Replies: 10 Views: 3,576 A note regarding clipboard usage, whenever you successfully open the clipboard, don't forget to close it by calling CloseClipboard() when you're done with the clipboard operations. |
Forum: C++ Jun 7th, 2008 |
| Replies: 20 Views: 2,278 Some more corrections in red ...
/*------------------------------------------------------------------
* Assignment 7: FIRST LINKED LIST ASSIGNMENT.
*Worth: 50 points
*Made by: Samuel Georgeo... |
Forum: C++ Jun 5th, 2008 |
| Replies: 2 Views: 515 I guess you are after this
class test
{
bool is_good;
public:
test() : is_good(true){} |
Forum: C++ Jun 3rd, 2008 |
| Replies: 4 Views: 648 I assume variable2 is std::string, in which case you are to use:
strcat(variable1, variable2.c_str());
Just in case you are not too familiar with std::string, you can avoid strcat() completely,... |