1,174 Posted Topics

Member Avatar for fddrummer06

The problem probably lies in how you use indexes. Note that array indexes are zero-based i.e. if you have an array holding 5 elements, the last valid index is 4, not 5. Consider [code] const char *article[ 5 ] = {"the", "a", "one", "some", "any" }; int i; // print …

Member Avatar for jephthah
0
785
Member Avatar for gctarzana

Learn to use code tags please ... [url]http://www.daniweb.com/forums/misc-explaincode.html[/url]

Member Avatar for Sky Diploma
0
2K
Member Avatar for Frazinray

[QUOTE=Frazinray;624316]Is this simply an installation problem?[/QUOTE] Sounds like one, try adding the Dev C++ .\bin folder into your PATH and see if that makes any difference. Might be that the Dev C++ installer does not comply with Vista leaving some things missing.

Member Avatar for Ancient Dragon
0
105
Member Avatar for Aamit

[QUOTE=Aamit;624434]I m not getting..it.. some more info or example code plz...[/QUOTE] Since you appear to be on Windows, one way is to use GetFileAttributes(), see [url]http://msdn.microsoft.com/en-us/library/aa364944.aspx[/url]

Member Avatar for Nick Evan
0
917
Member Avatar for AnjaliAnuradha

[QUOTE=AnjaliAnuradha;624032]I just want to know how the code should be modified to get decreasing order. Please help me.[/QUOTE] You need to study the impact of [icode]if( a[i] > a[j] )[/icode] statement. With regard to the merge sort code you posted, if you can compile it without errors, then get yourself …

Member Avatar for mitrmkar
0
121
Member Avatar for ambarisha.kn

Use cin .. [code] float f; // input one value cin >> f; // then .. push_back(f) int i; // input one value cin >> i; // then .. push_back(i) [/code]

Member Avatar for Nick Evan
0
155
Member Avatar for Aamit

Shouldn't you by now be familiar with code tags?? [url]http://www.daniweb.com/forums/misc-explaincode.html[/url]

Member Avatar for Ancient Dragon
0
138
Member Avatar for hazmatt

The memory that argv[0] points to is not writable. [QUOTE] I want to hard code the address in the program. [/QUOTE] Why don't you just do something like [code] opt_httphost = "the hard-coded address"; [/code]

Member Avatar for hazmatt
0
127
Member Avatar for lahom

Check in the generated msado15.tlh if it contains the ADODB namespace. i.e. see can you find the following in it [code] #include <comdef.h> namespace ADODB { ... [/code] I guess it does, in which case you can use either [code]using namespace ADODB; // or ADODB::_ConnectionPtr m_pConn; [/code] Which compiler are …

Member Avatar for mitrmkar
0
353
Member Avatar for marizion

[QUOTE=marizion;623133]i am currently doing my programming on windows xp home edition service pack 2; i am using dev c++ compiler 4.9.9.2 the name of the tutorial i read is titled "ole drag and drop from scratch" and here is the link: [URL="http://www.catch22.net/tuts/dragdrop.asp"]http://www.catch22.net/tuts/dragdrop.asp[/URL] and my code is [CODE]#include <"windows.h"> #include <"iostream"> …

Member Avatar for marizion
0
130
Member Avatar for mariaczi_pl

You need to add a new .cpp file, e.g. Form1.cpp, in which you implement the Form1 class's constructor. [code] // Form1.cpp #include "StdAfx.h" #include "Center.h" // include center.h to be able to construct a CCenter object #include "Form1.h" namespace RCK { Form1::Form1(void) { InitializeComponent(); CCenter^ Engine = gcnew CCenter(); } …

Member Avatar for mariaczi_pl
0
192
Member Avatar for mariaczi_pl
Member Avatar for Aamit

This code is capable of only installing and starting the service, it completely lacks the code implementing the actual service, so the error 1053 (ERROR_SERVICE_REQUEST_TIMEOUT) is expected. You might find the following links useful [url]http://www.devx.com/cplus/Article/9857/0/page/1[/url] [url]http://www.codeproject.com/KB/system/nt_service.aspx[/url]

Member Avatar for mitrmkar
0
492
Member Avatar for zoner7

I think you could use the following [code] for (int n=0; n <= 8; n++) { if (n != row && Board [row][column] == Board [n][column]) { return false; } if (n != column && Board [row][column] == Board [row][n]) { return false; } } return true; [/code]

Member Avatar for bugmenot
0
1K
Member Avatar for champnim

You open the port specifying FILE_FLAG_OVERLAPPED, but the WriteFile() call is missing the required pointer to an OVERLAPPED structure. (87 == ERROR_INVALID_PARAMETER)

Member Avatar for champnim
0
177
Member Avatar for Gagless

Whenever you 'delete' something, that something must have been allocated using the 'operator new', without exceptions. The [icode]delete [] List;[/icode] does the damage which is reported.

Member Avatar for faust_g
0
136
Member Avatar for SonxQ7

It's just not legal C, you are expected to write an expression there, not a return statement.

Member Avatar for jephthah
0
165
Member Avatar for William Hemsworth

I guess you are after this [code] class test { bool is_good; public: test() : is_good(true){} operator void * () { if(is_good) return (void*)this; else return 0; } void go_bad() { is_good = false; } }; int main() { test t; if(t) cout << "good\n"; else cout << "bad\n"; // …

Member Avatar for William Hemsworth
0
110
Member Avatar for VernonDozier

A reference for the options [url]http://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcc/Warning-Options.html#Warning-Options[/url]

Member Avatar for fierykido
0
1K
Member Avatar for Xokzin

[QUOTE=Xokzin;620554]Hi niek_e, I have change the function to this but still I can't get the value. [code=cpp]int updateCorrectTotal(char posi, int poin, int tFoward, int tBack) { if (posi == 'F') return tFoward += poin; else { return tBack += poin; }[/code][/QUOTE] It seems like you might intend to modify tForward …

Member Avatar for Xokzin
0
335
Member Avatar for FTProtocol

[QUOTE=FTProtocol;618813] Does anyone have any suggestions. [/QUOTE] Whether or not a given application starts up as hidden depends on how the application is coded. I.e. it may be that calc, for example, ensures that it starts up with a visible window.

Member Avatar for FTProtocol
0
121
Member Avatar for &rea

[QUOTE=&rea;620439]it does not work properly[/QUOTE] Could you be more specific about what it fails to do?

Member Avatar for Duoas
0
169
Member Avatar for Jennifer84

[QUOTE=Jennifer84;619919]Is this possible to use when you are writing the other code inside a buttoncontrol (Managed Area) ? I had some problem with this before also. [/QUOTE] I think you should very well be capable of using code inside a button click handler i.e. [code] // inside a handler vector<string> …

Member Avatar for Jennifer84
0
418
Member Avatar for ambarisha.kn

[QUOTE=ambarisha.kn;620451]why we have to use following code in STL programs. why it is needed. [CODE]use namespace std;[/CODE][/QUOTE] It is not obligatory, but if you omit it, then you have to explicitly specify the namespace whenever you access/use something within a namespace e.g. [ICODE][B]std[/B]::string mystring = "test";[/ICODE]. see [url]http://www.cplusplus.com/doc/tutorial/namespaces.html[/url]

Member Avatar for mitrmkar
0
279
Member Avatar for lahom

Here is one example about positioning a dialog box [url]http://msdn.microsoft.com/en-us/library/ms644996(VS.85).aspx#init_box[/url] You can pass the needed 'parent' dialog information through e.g. your dialogs' constructors.

Member Avatar for mitrmkar
0
335
Member Avatar for somename

See here for information on the permissions [url]http://linux.die.net/man/2/open[/url] [QUOTE][B]always[/B] it copy a binary into another which is just [B]empty file[/B][/QUOTE] You might post this code that always produces empty copies so we can see what goes wrong.

Member Avatar for somename
0
131
Member Avatar for asianguyjtran

You need to include the .cpp file, containing the ExecProcess() code, to your build process. If you are working with an IDE, add that file to your project.

Member Avatar for asianguyjtran
0
99
Member Avatar for Matthew
Member Avatar for tesuji
0
800
Member Avatar for linux0id

See the comments for explanation for the error ... [CODE] void *audio::audioThread( void *ptr ) { [B] // ptr is [COLOR="Red"]NULL [/COLOR]here[/B] audio *play = (audio *)ptr; // now you call playAudio() through a NULL pointer play->playAudio(); delete play; return NULL; } void audio::playAudio(void) { // here the 'this' pointer …

Member Avatar for linux0id
0
1K
Member Avatar for nirali35

[QUOTE=Radical Edward;619747] Edward doesn't have a solid reference on hand, but I don't think you can make a single non-static method be a friend. The friend has to be a non-member function or a whole class.[/QUOTE] Actually a member function can also be friend (just like the two functions in …

Member Avatar for nirali35
0
559
Member Avatar for CodeBoy101

[QUOTE=CodeBoy101;619844]Actually no, I get an error message saying: "cannot convert from std::string to const char." The parameters for strcat are: (char*, const char).[/QUOTE] I assume variable2 is std::string, in which case you are to use: [code]strcat(variable1, variable2.c_str());[/code] Just in case you are not too familiar with std::string, you can avoid …

Member Avatar for CodeBoy101
0
199
Member Avatar for Felic

Very difficult to say much without knowing more about those errors .. so you might post them.

Member Avatar for mitrmkar
0
93
Member Avatar for bookworm619

[QUOTE=VernonDozier;619367] [code] while (!cin.eof()) [/code] I've never used cin.eof() but I can't get this condition to fail regardless of what I type, so I end up in an infinite loop.[/QUOTE] The loop breaks when you enter Ctrl+Z.

Member Avatar for mitrmkar
0
100
Member Avatar for Jennifer84

[QUOTE] For the line below, the code also attach some text to the diagram "Curve1" so this text adds each time I press the button. So it seems that a line and the text just adds for each buttonpress. [code]LineItem ^myCurve; myCurve = myPane->AddCurve( L"Curve1", list, Color::Red, SymbolType::None );[/code] [/QUOTE] …

Member Avatar for Jennifer84
0
115
Member Avatar for Nameste

[QUOTE=m4design;618751] Or maybe you shout try adding this function before every cin statement: [B][COLOR="Red"]fflush(stdin);[/COLOR][/B] This will tae care of in reaming input from the standard input. If i'm saying something wrong I hope someone will correct me.[/QUOTE] [COLOR="Red"]Don't do that[/COLOR], see here [url]http://www.gidnetwork.com/b-57.html[/url]

Member Avatar for Nameste
0
121
Member Avatar for CodeBoy101

[QUOTE=CodeBoy101;619010]Is there a way to convert from an integer to a string?[/QUOTE] Yes, one way of doing it is ... [code] #include <iostream> #include <sstream> #include <string> using namespace std; int main() { int x = 123; stringstream ss; string s; ss << x; ss >> s; cout << s; …

Member Avatar for CodeBoy101
0
123
Member Avatar for myusernotyours

If I understood, you need to make your window to appear on top, in that case lookup the SetWindowPos() function.

Member Avatar for mitrmkar
0
74
Member Avatar for _Nestor

It is some sort of project configuration mismatch, you could post the complete command line of the compiler. Try looking in Project/Properties/Configuration Properties/C/C++/Command Line.

Member Avatar for mitrmkar
0
78
Member Avatar for joshmo

You simply need to initialize the pointers ... [code=cpp] nodePtr head = 0; nodePtr current = 0; [/code] The extern declarations of the pointers you have there, do not impact the actual variables' values in any way, in case you were expecting that to happen.

Member Avatar for joshmo
0
204
Member Avatar for William Hemsworth

[QUOTE=williamhemswort;618580]What is causing this difference in speed? :icon_rolleyes:[/QUOTE] You might be interested in the amount of memory de/allocation operations that occur during the tests. Gathering basic statistics on malloc/free/realloc calls is quite simple by means of _CrtSetAllocHook(), see [url]http://msdn.microsoft.com/en-us/library/820k4tb8(VS.80).aspx[/url]

Member Avatar for William Hemsworth
0
277
Member Avatar for FTProtocol

[QUOTE=FTProtocol;618448] Im really not sure why but it doesn't hide the window, i checked everything i could see but i think i've still done something wrong. any ideas? :([/QUOTE] Use the STARTF_USESHOWWINDOW flag ... [CODE] PROCESS_INFORMATION info; STARTUPINFO startup; memset(&startup, 0, sizeof(startup)) ; memset(&info, 0, sizeof(info)) ; startup.cb = sizeof(startup); …

Member Avatar for Ancient Dragon
0
108
Member Avatar for abbasi89

[QUOTE]can u write the whole code for me once...plz... and you can use inheritance and arrayas well plz use the easiest way and reply as soon as possile[/QUOTE] I think that will not happen, see here [url]http://www.daniweb.com/forums/announcement8-2.html[/url] If you post your effort (the code you've done this far), then you'll …

Member Avatar for mitrmkar
0
201
Member Avatar for lahom

If I understood the question correctly, then you need to add the following in your WM_INITDIALOG handler ... [icode]ModifyStyle(YOUR_DLG_HWND, 0, WS_SYSMENU|WS_MINIMIZEBOX, 0);[/icode]

Member Avatar for mitrmkar
0
84
Member Avatar for n00b3

[QUOTE]Then i receive a "properties.exe has encountered a problem and needs to close. We are sorry for the inconvenience." Windows error message. [/QUOTE] Appears as if lpszString would be NULL, so try adding a check against that condition ... [CODE] BOOL CALLBACK PropEnumProcEx(HWND hwnd, LPTSTR lpszString, HANDLE hData, ULONG_PTR dwData) …

Member Avatar for n00b3
0
225
Member Avatar for zzmgd6

[QUOTE=zzmgd6;617664]I wish I could find my old code.[/QUOTE] Somewhat off topic, but anyway, I think you might benefit from having your code under version control, here is one pointer to get you started with it ... [url]http://subversion.tigris.org/[/url]

Member Avatar for vijayan121
0
263
Member Avatar for joshmo

You might use seekg() along with tellg(), see here for an example [url]http://www.cplusplus.com/reference/iostream/istream/tellg.html[/url]

Member Avatar for Radical Edward
0
107
Member Avatar for Adrian99420

The following should work ... [CODE] private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { for ( int i = 0; i < checkedListBox1->CheckedItems->Count; i++ ) { listBox1->Items->Add ( checkedListBox1->[B]GetItemText[/B](checkedListBox1->CheckedItems[i]) ); } [/CODE]

Member Avatar for mitrmkar
0
146
Member Avatar for zawpai

Related to posting ... In case you haven't noticed, there is also a "Preview Post" button available. Press that button and you'll see a preview of how your post will look like. It does not submit your post, it just displays the preview.

Member Avatar for Nick Evan
0
319
Member Avatar for TylerTCF

The value of 'x' is invalid subscript at the point where the error occurs, it exceeds the size of Store2. You are using uninitialized variables (x, a) there, it's a bad practice. [code]void Write_Data(vector <Weather> Data) { double count, y, z, angle1, angle2, count2; int x, a, b; [B] // …

Member Avatar for mitrmkar
0
132
Member Avatar for cbattagler

The following might work for you, assuming that the values are always comma-separated [code] string line; double x,y,z; char dummy; // for skipping commas while ( getline(canopyfile, line) ) { stringstream iss(line); if(iss >> x >> dummy >> y >> dummy >> z) { holder.setx(x); holder.sety(y); holder.setz(z); canopyvec.push_back(holder); } else …

Member Avatar for cbattagler
0
192

The End.