15,300 Posted Topics
Re: Welcome to DaniWeb, Al. Hope you enjoy yourself here. [quote]Stuff you Dislike: Pain, people who have no ethics, people with bad temper and who are loud, inconsiderate jerks [/quote] Happily I have not met very many people like that :) | |
Re: delete line 17 because it is a do-nothing line. line 18 is pushing a pointer to an object that disappears from scope as soon as the function returns to main() -- the pointers are immediately invalidated. Why use a vector of pointers anyway? Just do this: [icode]vector<string> vect;[/icode] and everything … | |
Re: It doesn't work because planeamento table is not in the FROM clause. Correct the query by specifying the planeamento as you did in other places [icode]CONVERT(char(20), planeamento.dt, 105) [/icode] | |
Re: very easy to read just words [code] #include <string> #include <fstream> using namespace std; int main() { ifstrem in("filename"); string word; while( in >> word ) { // do something with this word } } [/code] | |
Re: dump that compiler and get VC++ 2008 Express because Microsoft fixed all of them. You no longer need to get the Windows Platform SDK or do all that manual setup in order to compiler MS-Windows programs. | |
Re: [icode]xyz = *(long *)abc;[/icode] That works when you KNOW that the character buffer contains the binary value of the long integer. For example [code] int main() { char abc[10] = {0}; long xyz = 123; memcpy(abc,&xyz,sizeof(long)); long xxx = *(long *)abc; cout << xxx << "\n"; } [/code] | |
Re: >> What's the problem here? Nothing. Your program produced expected results for me. I used VC++ 2008 Express. | |
Re: >>cin >> (choice,'\n'); What is that? All you need is [icode]cin >> choice;[/icode] Since choice is a single character you might also have to flush the input buffer with all remaining characters so that the next cin will work correctly. See [URL="http://www.daniweb.com/forums/thread90228.html"]this thread[/URL] that Narue wrote about how to do … | |
Re: 18 years ago I got this nice new job and I had to take over maintenance of a C program that was written by someone else long gone. The program was written for MS-DOS 3.1 operating system and had about 20 *.c files with lots of global variables scattered around … | |
Re: you could write your own version of new, delete, malloc, realloc and free then keep track of memory usage yourself. If you are running MS-Windows you could view the memory usage in Task Manager. | |
Re: >> since the only other variable on that line is file, and we're not writing to it. Oh but yes you are. [b]file[/b] is supposted to be a pointer to an open FILE object. >>sprite_filename You have not allocated any memory for fscanf() to save the characters. Needs to be … | |
Re: read [URL="http://www.velocityreviews.com/forums/t285784-constructor-protected.html"]this thread[/URL] | |
Re: Welcome to DaniWeb Mike. Sorry that I can't help you but I know there are several experts here that will be more than happy to help you out. Our [b]Web Development[/b] and [b]Site Management[/b] boards are probably just what you are looking for. | |
Re: If the list only needs to be sorted by book title then just insert new nodes in sorted order. I didn't test this but it should work something like below. You have to save a copy of the previous link when iterating through the list so that the program can … | |
Re: >>Any Ideas as to why it doesnt recognize df? Its a scope issue. You declared it locally in Void button_run_Click(), so its not visible in function delegate_function_callback(). | |
Re: >>(i know it isn't c++) then why did you post it in the c++ board? | |
Re: >>for a currency converstion program but I am unsure if I am doing the same thing with this one. I don't know what you did before, but it appears all your teacher wants you to do is write more pseudocode, you don't have to actually write the two programs. | |
Re: It works with cin and cout too. [code] // test1.cpp #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { cout << "Hello World\n"; return 0; } [/code] [code] // test2.cpp #include <iostream> #include <string> using namespace std; int main() { string line; getline(cin,line); cout << "\n\n" << line … | |
Re: now that you have posted all that code, what, if anything, is your question? | |
Re: Of course you don't. Don't you know SQL language? If not, then get a good book and learn it. [code] SELECT Projects.* from Projects, Employees where Projects.id = Employees.id and Projects.name = Employees.name [/code] | |
Re: It doesn't work because line line 23 [b]object2[/b] is a null pointer. The declaration on line 13 is hiding the declaration line line 6, so line 13 is not allocating memory for line 6. Also, line 15 is making the array of NULL pointers. | |
Re: try reading some of [URL="http://www.google.com/search?hl=en&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=how+to+read+excel+files+in+c%2B%2B&spell=1"]these gogle links[/URL] It would be a lot easier if you first export the excell file into a *.csv file because csv file is a plain text file that can easily be manipulated using C, C++, or any other computer language. | |
Re: just put lines 28 and 29 in a loop. After line 29 add an if statement to validate data imput. If its ok then exit the loop. | |
Re: Years ago we used Microsoft VC++ 1.52C compiler. We had a similar problem and found that malloc() itself cause memory leaks every few hundred calls. We wrote our own malloc() function and the problem disappeared. You might write a small test program to see if malloc() is doing something similar … | |
Re: >>Is NCurses compatible with C++? yes >>If so, how do I get a program started in it [URL="http://web.cs.mun.ca/~rod/ncurses/ncurses.html"]Instructions here[/URL] >> Is it just like a library where I include it as a header file after linking to an install directory Yes. | |
Re: According to the spacing of the code you posted it is missing a close bracket } after line 8 and before line 10 so that lines 1 thru 8 are contained within the if statement starting on line 1. | |
Re: just call [URL="http://www.hmug.org/man/3/modf.php"]modf()[/URL] | |
Re: what libraries, compiler, and operating system are you using to do all that drawing? If you want the previous cross to disappear when you move the mouse you will have to redraw the cross in the same color as the canvas background. It doesn't disappear on its own. [edit]Or, more … | |
Re: I created a new project in VC++ 6.0, copied the code you posted and compiled. Then imported the *.dsw file into VC++ 2008 Express. It compiled there with no changes, warnings, or errors. So your problem must be someplace else. Here is my program [code=cplusplus] #include <vector> #include <string> #include … | |
Re: nobody is going to be able to help you if you don't (or won't) post the code. Guess you will just have to learn how to use your compiler's debugger, if it has one. | |
Re: [URL="http://www.codeproject.com/KB/cpp/Ellipses.aspx"]Aritle about how to do that is here.[/URL] and the comments at the bottom of the page. | |
Re: You don't. One socket, one port. On the server side you can reserve a block of ports for use by the server's clients in the [b]hosts[/b] file. The location of that file depends on the operating system. On my computer running Vista its located here: D:\Windows\System32\drivers\etc | |
Re: The first OpenFile() should be pretty easy. Use the [b]new[/b] operator to allocate menory for an array of ifstream objects, open each of the files, then return the array. The second function is a little more complicated. You will need a loop to read one line from each file in … | |
Re: I have no idea what [b]invoke[/b] does. Never heard of it. | |
Re: I don't think there is any one right answer. I try not to use pointers unless absolutely necessary because they can cause memory leeks and other problems. | |
Re: >>I don't want to use system tables query and things like that. Things like what? If you use ODBC the result set will contain the table information for the columns returned. I'm sure you could also query the system tables for the info using ODBC. More information might be found … | |
Re: [QUOTE=selfhelpebooks;610967]Hi there, Very ambitious individual aren't ya! Welcome to the site, too.[/QUOTE] Being from China I'll bet English is not his/her first language. So I think the word he wanted to use was [b]devote[/b], not [b]sacrifice[/b] | |
I think this has raised its ugly head again. Every time (well most of the time anyway) I post in a thread I get this error: [quote]The following errors occurred when this message was submitted[/quote] But if I hit the IE7's Refresh button my post was acaully made. | |
Re: [QUOTE=cebubinary;608692]HI guys. Im a student and studying c++ that and cmd and so far i stil havent figure out how to change my current dir while my program is running. [/quote] See _chdir() function [QUOTE=cebubinary;608692]My program is that i want to make a test.txt file with a "my test file" … | |
Re: >>I need solution to this immediately. Ok, so why don't you write it. I am watching American Idol on tv and don't have time :) | |
icode doesn't retain white space like code tags. Is it possible to make them consistent? Example: // using icode tags [icode]"Now is the time "[/icode] // using code tags [code]"Now is the time "[/code] | |
Re: use srand() to seed the random number generator, rand() to get a random number, and the mod operator % to imit the number betwen 1 and 10. Get that working in your program first, then we can talk about how to make it do that every 1/2 second. You can … | |
Re: line 27: That whole function is screwy. When line 27 is executed it will stop that loop because the function will end. The code you put there is not what that function should be doing at all. It's supposed to search though the array and erase the item that contains … | |
Re: Well, how do we get the questions and how to we respond to them ? If you post the questions here we can either post our answers or sent you PM with the answers. I know DaniWeb normally does not allow answers via PM but this may be a special … | |
Re: Welcome to DaniWeb -- I'm just a few 5 years younger than you :) I think you and I are the oldest here, but there are a couple others pretty darned close. I hope you feel free to share your experiences and vast knowledge with everyone here on the technical … | |
Re: Welcome to DaniWeb. You can advertise your job needs in the [URL="http://www.daniweb.com/forums/forum72.html"]Looking To Hire Forum[/URL] | |
Re: line 13 is wrong. You are passing a pointer to a pointer as the second parameter. Leave off the & symbol [icode]ReadFile(hFile, [color=red]someread[/color], sizeof(someread), &n, 0);[/icode] Also the program should check to see that CreateFile() succeeded. Never assume success. If [b]myfile.txt[/b] is a standard ascii text file with lots of … | |
Re: >>anyone knows why? Yes. how about something like this: [code] char* lastWord = NULL; while( tok != NULL ) { lastWord = tok; tok = strtok(NULL, " "); } printf("%s\n", lastWord); [/code] | |
Re: They always look like that on my computer. Thought it was just me because I have the font size set pretty high on my computer. |
The End.