15,300 Posted Topics
![]() | Re: [URL="http://msdn.microsoft.com/en-us/library/ms632644%28VS.85%29.aspx"]WM_SETTEXT[/URL] |
Re: 1) check to see if db exists? That would be like checking if any other file exists, e.g. attempt to open it and if open failes then the db does not exist. 2) write a query to get all results, e.g. "SELECT * FROM MyTable" then view the results returned. | |
Re: [URL="http://lmgtfy.com/?q=win32+api+tutorials"]Click here[/URL] | |
Re: >>std::list<Operation *> *OPlst; >>OPlst = new std::list<Operation *>; Why in the world is this a pointer??? It should be just this: [icode]std::list<Operation*> OPlst;[/icode] | |
Re: >>can you check if my program code is right Didn't you compile and run it to see for yourself?:?: | |
Re: Yup! glad you are finally figuring that out! Never put a function call there which will always return the same value -- its better and faster to store the value in a variable and use that variable in the loop. | |
Re: new operator causes an exception if it cannot allocate the memory, so your check for NULL will not do anything. You need to put that line in a try/catch block. As an alternative, you can use [b]nothrow[/b] ([URL="http://http://www.cplusplus.com/reference/std/new/nothrow/"]link[/URL]) and leave that check in your code. I would think you need … | |
| |
Re: Just download the binaries from [URL="http://http://www.gtk.org/download-windows.html"]here[/URL], and unzip them into any directory you want. Then in your makefile use -I flag to point to that directory. | |
Re: static class data objects also have to be declared like normal globals. [code] #include "DivSales.h" #include <iostream> using namespace std; [color=red]DivSales::totalSales = 0;[/color] void DivSales::addTotal(int a, int b, int c, int d) { cout << "Enter 1st Quarter:" << endl; cin >> a; cout << "Enter 2nd Quarter:" << endl; … | |
Re: you have to overload the << operator [code] class MyClass { public: friend ofstream& operator<<(const ofstream& out, const MyClass& str); .. ... }; [/code] | |
Re: The fopen() statement is the same, except with "w" open flag instead of "r" use fprintf() to write text lines. | |
Re: Some c++ stl classes, such as string, vector, and list, return size_t in some of its methods. For example. std::vector size() returns size_t value. Some compilers (such as Microsoft) will produce warnings if you attempt to compare size_t with int or long. | |
Re: If you want the output to go to two places (screen and file) then you will have to print it twice. Put the code in a function then pass it the stream object (either an opened FILE* pointer or stdout) | |
Re: In the test project you have either (1) include Engine.cpp so that it's compiled along with test.cpp, or (2) create either a DLL or static lib out of Engine.cpp, then link test project with that lib. | |
Re: [b]front[/b] is a function, so you need () [code] #include <iostream> #include <list> using namespace std; class Aircraft { public: Aircraft(int i = 0) { flightNo = i; } int getFlightNo() { return flightNo; } void setFlightNo(int i) { flightNo = i; } protected: int flightNo; }; int main() { … | |
Re: The link you posted doesn't have any downloadable files -- its just a tutorial. | |
Re: >>I still encounter problem with conversion of string variable to numeric variable using strtof() function call. It seems that that function requires a char instead of string for the conversion If you had bothered to read the methods available to std::string you would have seen c_str(), which returns const char*. … | |
Re: A better flu solution | |
Re: There are no compilers thatt will do it. If you are running MS-Windows then view Task Manager while the program is running and it will tell you how much memory it is consuming. | |
Re: Just tested it -- 1:15 minutes from the time I pressed the power-on button until the login screen appears. About another minute until the desktop is usable. But the time for that part would vary greatly from one computer to another due to what all is installed that has to … | |
Re: The read should work, but the write doesn't because you are trying to write binary data to the console screen. The number will have to be converted to ascii readable characters first. [code] char buf[20]; sprintf(buf,"%d", num); fwrite(buf,strlen(buf),1,stdout); // but why?? this is the same as printf() [/code] | |
Re: No way around it if you want to use normal string handling functions found in string.h and stdio.h. You will have to treat the character array as containing binary data. Well, I suppose you could create the string to contain normal decimal values such as [icode]char num[] = "01";[/icode] | |
When I click on "Site Search" with empty search box the browser used to bring up another window that would let me select several options. That is no longer possible. | |
Re: So, let me get this straight: you told your prof that you will write a program that you have no clue how to write??? Like biting off more than you can chew? On a scale of 0 to 100% how well do you know c++ or c ? Are you … | |
| |
Re: According to those pictures men also have much lower IQ than women :) | |
Re: O_RDWR is used by very low-level C _open() function. Most programmers today use higher-level FILE* functions in C or fstream c++ class. But if you read[URL="http://msdn.microsoft.com/en-us/library/z0kc8e3z%28VS.80%29.aspx"] this link[/URL] you will see that O_RDWR is NOT one of the pmode flags -- pmode refers to permissions and is useful only when … | |
Re: you can't change the < operator to >, but you can change i to be greater than End and Step to negative, which I believe will accomplish the same thing. | |
Re: [URL="http://www.codeproject.com/KB/GDI/barry_s_screen_capture.aspx"]read this[/URL] tutorial | |
Re: Maybe the image is too big? I changed mine just yesterday with no problems. | |
Re: [QUOTE=omri374;986825]Thanks! Since I don't know much about Multithreading,[/QUOTE] There's no better time than the present to learn. Write a simple console program that does nothing much more than create another thread and wait for it to finish. That is enough to show you how threads work -- its not really … | |
![]() | Re: Its done almost like you posted it. Post what you have tried so that we can see what you might be doing wrong. You have to include <string>, and its lower-case "string", not "String". C++ is case sensitive, so you have to be careful about using capital letters. |
Re: To delete an item from an array just move everything up one element so that the one you want to delete is overwritten. For instance, if you have an array of 10 integers and you want to delete the first one, then copy #1 to #0, #2 to #1, etc. | |
Re: If you only want it to do something every hour, then put it to sleep for an hour - this is MS-Windows, *nix would be sleep() with lower-case 's'. [code] while ( 1 ) { Sleep(60*60*1000); // sleep for one hour // stuff } [/code] | |
Re: Never heard of it, so I answered No. | |
Re: a) Flag Bad Post does not affect post count. b) Already asked for that awhile back but they shot it down. | |
Re: Two ways to do it that I can think of right off the top of my head 1) after reading the entire line, use std::string's find() method to locate the first comma then you will have the id field. Something like this [code] std::string line = "paciss0:abc,123,myoffice"; // locate the … | |
Re: >>int countCharacter(char desired, char[] list) The [] is in the wrong place -- should be [icode]char list[][/icode] | |
Re: Your program makes zero sense. Why are you using ofstream to write to a dll ?????:icon_eek: | |
Re: Read the file into a linked list, sort it, then write it back out. That will work for files that are not very large. For really huge files (1+gig) there are file sort programs you can get (see google). a) Read the words into a linked list of structures. If … | |
Re: Maybe that's the way to go :) But I don't think I'll try doing that with my computer. | |
Re: I tried to compile that with vc++ 2008 Express on MS-Windows and got the following error. Maybe that is why your program seg faults, because there were compile errors that you failed to fix [quote] 1>c:\dvlp\test1\test1\test1.cpp(52) : error C2065: 'files' : undeclared identifier 1>c:\dvlp\test1\test1\test1.cpp(53) : error C2065: 'files' : undeclared … | |
Re: >>This is what i have but not working????????? Well, what is it that is not working? Doesn't it compile? If not then what are the error message(s)? And what compiler are you using ? | |
Re: I implemented something like that (I think) many years ago with MS-DOS 6.X. It was a series of functions that performed context stack switching so that there could be any number of "threads". Unlike modern-day MS-Windows or *nix, the program would switch contexts only when requested by the currently running … | |
Re: eVC++ isn't really all that much different than VC++ 2008 Express. c++ is c++ is c++. Once you learn c++ on desktop its pretty easy to develop with eVC++. There are some things that eVC++ does not support (at least prior to version 4.0) -- some of them are: [list] … | |
Re: >>When using CreateProcess with any of the debug flags Do you mean the debug flags that can be set in the [b][URL="http://msdn2.microsoft.com/en-us/library/ms684863.aspx"]Process Creation Flags[/URL][/b] of the CreateProcess function ? BTW: I have never used this feature | |
Re: The stats in Control Panel seems to have a few problems. >>Forum Threads Started: 3,668 I have not started that many threads! :icon_eek: According to the link "search all threads started by ...", I only started 190 threads. | |
Re: Line 28: 1) use a different loop counter name because it is hiding the loop counter declared on line 18. 2) why does that loop begin at 2 instead of 0, such as like this? [icode]for(int j = 0; j < nrAttend; ++j) [/icode] | |
Re: [QUOTE=insaniakq;930695]i used to use the recycler to hide files, then one day all the files disappeared, i swapped the hard drive to a new computer and that computer deleted the folder[/QUOTE] I'd say that wasn't the brightest place to hid files :) :) |
The End.