1,174 Posted Topics
Re: [QUOTE=wade2462]argument of type "const char *" is incompatible with parameter of type "LPCWSTR"[/QUOTE] See this codeproject article [URL="http://web1.codeproject.com/Tips/76252/What-are-TCHAR-WCHAR-LPSTR-LPWSTR-LPCTSTR-etc.aspx"]What are TCHAR, WCHAR, LPSTR, LPWSTR, LPCTSTR etc?[/URL] | |
Re: Your ifstream is in a fail state once you have exited the loop. To make the stream functional again, use [URL="http://www.cplusplus.com/reference/iostream/ios/clear/"]clear()[/URL], like so.. [code] // Clear out any error state bits in.clear(); // Now seekg() will work in.seekg(0, ios_base::beg); [/code] Then, don't use .eof() in a loop control, it will … | |
Re: [QUOTE=azra36] the call stack has following values. fwrite(const void * 0x0012ee5c, unsigned int 0x00000001, unsigned int 0x00001000, _iobuf * [COLOR="Red"]0xffffffff[/COLOR]) line 105 + 3 bytes [/QUOTE] The last parameter for fwrite() has an invalid value (0xffffffff). Make sure that you succeed in opening the file properly (using fopen()), like so … | |
Re: [QUOTE=lionaneesh]is giving segmentation error when reaching the fprintf() function ......[/QUOTE] You have a really nasty bug there, something is wrong with the following line .. [code] ... if(logs = NULL) ... [/code] Furthermore, if you fail to open the log file, then you must NOT try to fprintf() anything to … | |
Re: [QUOTE=tomtetlaw]check if the shift key is being held down when processing use input?[/QUOTE] I believe GetKeyState() will do the work, see an example of it here [URL="http://msdn.microsoft.com/en-us/library/ms646268%28v=VS.85%29.aspx#displaying_input"]Using Keyboard Input[/URL] | |
Re: Ancient Dragon has written a snippet that you can build upon, see [URL="http://www.daniweb.com/code/snippet249201.html"]How to get size of all files in a directory[/URL] | |
Re: [QUOTE=Kesarion]There is still a problem with the wind function though.[/QUOTE] You might post the complete code (including main()). ![]() | |
Re: [QUOTE=darelet]I think the Problem is more of C++ than it is an OpenCV one.[/QUOTE] Looking at the code you've posted, you have huge problems with memory overruns, and forgetting to delete the allocated memory (which may be hiding these overruns). One option would be to use [ICODE]vector<float>[/ICODE] for all of … | |
Re: Remove the [ICODE]#include "newmenu.rc"[/ICODE] from the source file. It is only to be included via the Solution/Project that you have - i.e. that file should display in the Solution Explorer. To add the file to the solution, use Project / Add Existing Item and pick the .rc file - that … | |
Re: [QUOTE=keeda] What does -Wall and -pedantic options stand for? And also as I am new to this system can you please refer me a link where I can learn more about these options?[/QUOTE] See [url]http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#Warning-Options[/url] | |
Re: [QUOTE=cscgal;1190745]Now that's just wishful thinking ;)[/QUOTE] Daniweb has a quite nice sortiment of smilies, but this makes me think that there's one missing, that would be: 'Icon Sigh', or some such. | |
Re: A very [I]basic[/I] C++ tutorial that you might check out -> [url]http://www.learncpp.com/[/url] | |
Re: [QUOTE=yongj]I get an error when I put cout as a parameter.[/QUOTE] Using [ICODE]cout[/ICODE] as a parameter is OK - that's not the error. Looking at the error message, it seems that you don't have written code for default constructor of class [ICODE]Customer[/ICODE]. | |
Re: Try to implement the following [code] class Complex { ... // friend - allows access to private members friend ostream & operator << (ostream &, const Complex &); ... }; [/code] | |
Re: [QUOTE=godflesh231]i can't tell which part of my code is faulty as VC++ points me to this code from <xlocale>[/QUOTE] At that point, open the Call Stack window (Debug / Windows / Call Stack) - likely you'll be able to step into your own code to see the offending line. | |
Re: The compiler sees that line as a declaration of a function ([ICODE]t2[/ICODE]) which takes no arguments and returns an object of class [ICODE]test[/ICODE]. | |
Re: The page [url]http://www.daniweb.com/forums/misc-explaincode.html[/url] is not displaying at least for me. | |
Re: [QUOTE=kourt32] i did this and it outputs only 1 file with the file name in it but i would like to output 3 so what is breaking the check ? [/QUOTE] You [I]must initialize[/I] [ICODE]count[/ICODE] to a value of your choice. It is NOT initialized to zero by your compiler. | |
Re: That is weird behaviour, see what [ICODE]GetLastError()[/ICODE] tells you. | |
Re: There is no mention of what a [ICODE]Collectable[/ICODE] represents. Then it looks like your classes need to be inheriting from [ICODE]Collectable[/ICODE] in order for the allocations/assignments to work. | |
Re: [URL="http://msdn.microsoft.com/en-us/library/zxt206sk%28VS.80%29.aspx"]Compiler Error C2259[/URL] [B]>> I cannot see why i am getting them..[/B] For future reference, it's better to post the offending code along with the error messages. | |
Re: Which compiler are you using? Isn't it giving any warnings? The [ICODE]array[/ICODE] is a zero-sized array, you want to specify a reasonable size (a compile time constant) for it, in order to use it. Alternatively, perhaps use [ICODE]std::vector<Trader>[/ICODE]. | |
Re: Only considering the [I]formatting[/I] of the code, consider a more readable alternative .. [code] #include<iostream> using namespace std; int main() { char letter; int counter = 0; //set the counter to 0 for (letter = 65; letter <= 122; letter++) { if( (letter == 91) || (letter == 92) || … | |
Re: [QUOTE=Roses89]i keep getting : -on line 7(i.e vector<Bid> BidList (20);) : error 7 expected `;' before '(' token -and in simulator:20 `BidList' undeclared (first use this function)[/QUOTE] The compiler does not have a clue about what a 'Bid' is at line 7. You might swap the order of the classes, … | |
Re: [QUOTE=BLKelsey] Currently, LOAD GAME appears and immediately goes into the game without any "wait(n)" intervals. Why won't it work?[/QUOTE] Well, you initialize [ICODE]int countdown = 5[/ICODE], so that will cause it to bypass the for-loop altogether. PS. I recently saw; "When C++ is your hammer, everything starts to look like … | |
Re: First, open [url]http://www.daniweb.com/forums/forum16.html[/url] and there, click the area where it reads; "Databases Category (Click to show forums)" I bet you'll manage to take it from there ... | |
Re: [QUOTE=Scu]I guess it all strats from this C2653 error which speads through all my new header files.[/QUOTE] The first error that occurs is: [code] Error 3 error C1083: Cannot open include file: '[COLOR="Red"]lists[/COLOR]': No such file or directory i:\sync\sortwaternetwork\sortwaternetwork\noduri.h [/code] However, that does not match the [ICODE]noduri.h/#include <list>[/ICODE] that you … | |
Re: Please use code tags. Wrap all your code inside the code tags, like .. [noparse] [code] your code here [/code] [/noparse] You still have ~15 minutes to edit your post. | |
Re: [QUOTE=0x69]Because I've not seen that difference documented in [URL="http://en.wikipedia.org/wiki/Compatibility_of_C_and_C%2B%2B#Constructs_valid_in_C_but_not_C.2B.2B"]wikipedia here[/URL] Maybe I looked not in that direction or do we need to modify wiki, huh ? :)[/QUOTE] That Wikipedia page links to [URL="http://david.tribble.com/text/cdiffs.htm"]Incompatibilities Between ISO C and ISO C++[/URL] where this is explained, see the section "Empty parameter lists". | |
Re: I believe your 'username' pointers ([ICODE]nom_usuario[/ICODE]) end up pointing to the same index of the one and only buffer you are using (i.e. [ICODE]buffer[/ICODE] indirectly via [ICODE]buffer2[/ICODE]). Try changing the code to [ICODE]malloc() + strcpy()[/ICODE] the username data instead, like so.. [code] int insertar(char* buffer2, struct lista* maestra,int count, char* … | |
Re: I'd bet that it happens due to an [I]uncaught exception[/I] of type [ICODE]digits[/ICODE]. Hint: there is something wrong at line #72. [EDIT] Isn't your compiler giving a warning of any kind, have you checked? Note that I'm assuming that you are actually calling the [ICODE]string_to_int()[/ICODE] function. | |
Re: You don't want to have the vector ([ICODE]mydouble[/ICODE]) declared inside the for-loop, because that gives you a fresh re-constructed vector on every iteration of the loop. So declare the vector in another scope, outside the loop. | |
Re: [B]>> My C++ is rather old but this should work.[/B] Sorry but that will not work either. Consider compiling the code that you post. Even if you are posting minimal snippets/one-liners. | |
Re: This is somewhat a guessing game without the exact code. But I'd suggest that you open the header file and scroll down to the very bottom of it, just to see that there absolutely isn't anything after the semicolon that ends the class declaration. | |
Re: Have you visited [url]http://www.neurotechnology.com/fingerprint-scanner-digitalpersona-u-are-u-4000.html[/url] Looks like there are 3 available SDKs, perhaps with helpful sample applications. Moreover, they seem to have a dedicated forum there, so that might be a good place to post questions. | |
Re: [QUOTE=lionaneesh;1214245] [B][U]About Malloc[/U][/B] Malloc() is ... [/QUOTE] It is malloc (not Malloc). [QUOTE] [B][U]References[/U][/B] No references guyz ... Only one my "brain" .. LOL.. [/QUOTE] You can find the current draft standard here .. [url]http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1256.pdf[/url] | |
Re: Just a suggestion, maybe you'd be better off without [ICODE]strtok()/atoi()[/ICODE] altogether, using [URL="http://linux.die.net/man/3/sscanf"]sscanf()[/URL] instead. A minimum example to try out .. [code] #include <stdio.h> int main() { const char * str = "255.255.255.0"; int arr[4]; int res = sscanf(str, "%d.%d.%d.%d", &arr[0], &arr[1], &arr[2], &arr[3]); /* Did sscanf() convert 4 fields? … | |
Re: It looks like you are doing assignments (=) instead of comparisons (==), so check your if-statements .. [code] // You want to have .. if(board[x][y] == '.') ... [/code] And please use code tags. | |
Re: [QUOTE=athenaabc;1213867]I must load it in the center of client area and after there moving using keys but it doesn't work[/QUOTE] Just quickly commenting on this keyboard ineffectivity, what do the following lines do? [code] pt.x=new_rect.left; pt.y=new_rect.top; [/code] | |
Re: [QUOTE=caut_baia;1213872][code] #include <iostream> int main () { int count=0; char* str; std::cout << "Enter word: " << std::endl; std::cin >> str; for (;*str!='\0';count++,*str++) {} std::cout << count; } [/code][/QUOTE] Hmm, have you tested that? Does it work as expected? | |
Re: In freqMake(...), you allocate a new [ICODE]Node[/ICODE] but fail to initialize its [ICODE]pLeft[/ICODE] and [ICODE]pRight[/ICODE] pointers (when [ICODE]tree != 0[/ICODE]). Later on you end up using these pointers, which gives you the error. | |
Re: [QUOTE=ziyakhan10;1209445]but the final output comes out in the form of an infinite loop[/QUOTE] Adding one thing... you are writing to a file named "emp.dat" and then trying to open "emp.[COLOR="Red"]txt[/COLOR]", which presumably does not exist (?). The bad usage of .eof() does not protect you from this. You can use … | |
Re: Your for-loop is wrong .. [CODE] void getRaise(double pay[], int size) { // should rather be .. for(int x=0; x <size; ++x) ... [/CODE] | |
Re: Perhaps have a look at [URL="http://www.cplusplus.com/reference/stl/priority_queue/priority_queue/"]priority_queue::priority_queue[/URL]. | |
Re: What are the values of MOUSEDOWN MOUSEUP MOUSEOUT MOUSEOVER They must be in the range 0..3, inclusive. | |
Re: [quote=g++] main.cpp:48: warning: format '%s' expects type 'char*', but argument 2 has type 'int*' main.cpp:153: warning: format '%s' expects type 'char*', but argument 2 has type 'int*' [/quote] You want to treat these warnings as actual errors and fix them. PS. The line numbers of these two warnings match the … | |
Re: Please use code tags -> [URL="http://www.daniweb.com/forums/misc-explaincode.html?TB_iframe=true&height=400&width=680"]What are code tags?[/URL] You still have ~25 minutes to edit your post and fix the tags. Then you might try to be more specific as for your problems. | |
Re: Please use code tags. What does [code] cout << RegOpenKey(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\Run\\microsoft security",&hKey) << endl; [/code] say ? | |
Re: The output does not really match with the code you've posted, too bad. But I suspect that something like following occurs .. [code] // You prompt for the dog's name .. cout << "Enter dog1's name: "; // Note: weight cin >> dog1->weight; // You actually typed in a string … |
The End.