15,300 Posted Topics
Re: what operating system and compiler? | |
Re: why are you using endl with stringstream? Doesn't make any sense because all endl does is '\n' followed by stream.flush(), which is intended to flush data to hard drive. So what you are really writing is this: [icode]out << name << '\n' << flush << ...[/icode] | |
Re: [URL="http://lmgtfy.com/?q=subclass+mfc+control"]2[/URL] | |
Re: >>#include<iostream.h> >>void main() Get another teacher because that one doesn't know what he/she's doing. Better yet, go to a different school because that one is probably trying to teach you how to program in the 21st century with a compiler that was written in the 2nd century (e.g. Turbo C++) … | |
Re: Microsoft products probably use [URL="http://en.wikipedia.org/wiki/Code_page"]Code Pages[/URL] Also read about them [URL="http://www.google.com/#sclient=psy&hl=en&q=code+pages&aq=f&aqi=g5&aql=&oq=&gs_rfai=&pbx=1&fp=207a1c3c62b92b94"]here[/URL] | |
Re: >>The problem is when I go to close my program either by the X at the top right, or using the right button of my mouse which has code to destroy the application. It hangs, and does not terminate the program Most likely because it is processing all those WM_LBUTTONDOWN … | |
Re: Why would you want to write an address to a text file? It isn't useful for anything after the program that gets the address is finished. | |
Re: Help you do what exactly? Write the program for you? No in this lifetime. I assume you have a choice of whether you want to store those user names and passwords in a password text file or just hardcode them in your program. The instructions was ambiguous about that. Create … | |
Re: You are setting dialog_close flag too late. Set that to 5 in the [URL="http://msdn.microsoft.com/en-us/library/866bc849(VS.80).aspx"]OnClose[/URL]() event handler. | |
Re: Call [URL="http://msdn.microsoft.com/en-US/library/wdhxwhcx(v=VS.80).aspx"]DeleteItem[/URL]() to remove an item from CTreeCtrl. You have to call that function for each item you want removed. | |
Re: Have the server check the packet ID field and it will know which packet its getting. Hopefully the ID field is the first item in the packet to make it easier for the programs to reconstruct the appropriate structure. For example the client would read the first byte from the … | |
Re: weight_ is an integer, but the parameter in the constructor has it as a double. Which is it??? The sortingFunction() function should use < operator, not <=. [edit]Oops! already answered. | |
Re: @nbaztec: The += operator does not work with integers. 1) ListBox is most likely a private member of MyProgDlg.cpp and is therefore unaccessible outside that class. 2) CString class has a Format() method whose parameters are identiacal to sprintf() [code] CString str; DWORD dbIndex = 123; str.Format("Line# %u", devIndex); [/code] | |
Re: GetSystemMatrics() works for the display monitor only. You have to call other win32 api functions to get the informatgion you want. To get the window's height/width call [URL="http://msdn.microsoft.com/en-us/library/ms633519(VS.85).aspx"]GetWindowRect()[/URL] | |
Re: which government (country)? In USA you have to take a Civil Service exam in order to get a job with the US government. See your local Civil Servie to get that exam. [URL="http://www.usajobs.gov/infocenter/"]Here's a link[/URL] | |
Re: First use Microsoft's memory diagnostics tool described [URL="http://www.tomstricks.com/how-to-test-your-ram-or-memory-with-windows-memory-diagnostic-tool-in-windows-7/"]here[/URL] to verify the computer's ram is ok If that's ok then check the hard drive for errors -- [URL="http://windows.microsoft.com/en-US/windows-vista/Check-your-hard-disk-for-errors"]click here[/URL]. If there are no errors there either, then most likely its a problem with the program you are running. I'd go back … | |
Re: Of course it doesn't work. Since you can't rewrite the file, the only thing I can suggest is when the file is originally written pad each line with spaces at the end to make room for the new data. So instead of [code]"1 2"[/code] you would have written [code]"1 2 … | |
Re: Under Windows 7 you will get that error if you are not the one who created the folder in the first place. Log into your computer as Admin account and you should be able to delete the folder. If not, then (again running as Admin) change the folder's properties and … | |
Re: [URL="http://www.precisesecurity.com/files-process/2010/08/13/winconfig-js/"]Its a virus -- read this[/URL] | |
Re: Your program is trashing the stack and/or the heap somewhere. I compiled with vc++ 2010 express and it get assertion error when exiting the program. | |
Re: sizeof(*np) is NOT dereferencing the pointer. The sizeof is an operator that is expanded at compile time, not runtime. *np is just getting the type of object that np was declared as, in this case struct nlist. sizeof(*np) is just another way of saying sizeof(struct nlist). Programmers like to use … | |
Re: Probably yes. Why don't you just try it and find out for yourself. | |
Re: You will most likely have to write your own sort algorithm and swapping, so that you can keep both colums together when a swap is needed. If you have never written a sort algorithm, then I will suggest the [URL="http://en.wikipedia.org/wiki/Insertion_sort"]Insertion Sort[/URL], because it's the easiest to implement, even though it … | |
Re: breakpoints do not tamper with windows focus, but does screw up keyboard focus. If you're trying to type something and a breakpoint occurs then the keyboard focus is lost. Yes, I've encountered that situation. I've use Micirosft compilers (vc++ 6.0, 2005 and 2010) to debug lots of difficult programs, including … | |
Re: Where does IsValidReadPtr exist? I can't find it with google. There is an IsBadReadPtr(), but M$ says its obsolete and not trustworthy. >> is there a function which says "Yes There is Microsoft's IsWindow(). Other than that -- no. [edit]Oh I think I know where you found IsValidReadPtr -- in … | |
Re: Welcome to DaniWeb. Interesting -- how did go from electronics to patient research? | |
Re: Get OpenOffice -- it is free and compatible with M$ Office. | |
Re: This is the basic idea, you might have to modify it to suit yourself, such as do error checking and trim whitespace from end of the mac address after extracting it from the line. [code] std::string foo(std::string search) { std::string line; ifstream in("filename.txt"); while( getline(in, line) ) { size_t pos … | |
Re: The structure isn't correct, you don't have to specify the number of digits in the integers. A single integer can hold lots of digits (see limits.h in your compiler's header files). [code] typedef struct { int site_id_num; /* id number of the site */ int wind_speed; /* the wind speed … | |
That button doesn't work in New Articles. It's supposed to take me to the first unread post in the thread, but it doesn't. | |
Re: You mean you can't send/receive files using Windows Explorer? If not then how are you trying to do it? | |
Re: Probably this [URL="http://www.boost.org/doc/libs/1_43_0/libs/dynamic_bitset/dynamic_bitset.html"]boost library[/URL] | |
| |
Re: turbo c++ is an ancient compiler that uses obsolete c++ header files and follows obsolete c++ standards. Bring yourself into the 21st century and learn how to write modern c++ code. That is one of the problems with learning to program using ancient turbo c and turbo c++. You switch … | |
Re: Mine has this entry %CommonProgramFiles%\Microsoft Shared\Windows Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\ | |
Re: use [URL="http://www.cplusplus.com/reference/clibrary/ctime/strftime/"]strftime()[/URL] and you can format the date any way you want. All you need is a struct tm object. And you can get that from either localtime() or mktime() | |
| |
Re: >>void input_data (string first_name, string last_name, string street, string city, int zip); That is not call by reference -- its call by value. This is call by reference void input_data (string& first_name, string& last_name, string& street, string& city, int& zip); | |
Re: How to start will depend on the problem. They all start like this: [code] // include header files here // declare function prototypes (if needed) here int main() { // put code here } [/code] | |
Re: So what's the big deal about writing that operator overload ? I'm guessing those containers need that operator so that they can make binary searches. If the data is not ordered then they would have to resort to simple sequential linear searches. | |
Re: >> fflush(stdin) -- that is non-standard C code which is not supported by very many compilers. If you compiler does, ok, but don't expect the program to compile by your instructor's compiler. And that might get you a lower grade. move line 25 up to line 18 so that the … | |
Re: >>using hbg_cmpsc122::Fractions; Fractions is not in namespace hbg_cmpsc122 because you have misspelled the class name. Pay closer attention to spelling and capitalization -- fraction is not the same thing as Fraction. What compiler are you using? I'm on MS-Windows using vc++ 2010 Express and I get lots of error messages … | |
Re: Why are you using low-level file i/o?? Just use FILE* and all will be ok. The only reason to use open() is when the compiler for the target operating system doesn't have FILE* and associated functions. But to answer your question, [URL="http://www.opengroup.org/onlinepubs/009695399/functions/lseek.html"]lseek[/URL]() returns the file offset. | |
Re: maybe you are not opening the file in binary mode. This works ok for me [code] int main() { int *parray = 0; int ay[] = {1,2,3,4,5,6,7,8,9,10}; int size = sizeof(ay) / sizeof(ay[0]); FILE* fp = fopen("filename.dat","wb"); fwrite(ay,sizeof(int), size,fp); fclose(fp); parray = new int[size]; fp = fopen("filename.dat","rb"); fread(parray, sizeof(int), size,fp); … | |
Re: First declare a structure that contains elments for street address, suburb, and price. Then useing ifstream open and read the file. I could write the code for you, but I won't. I wouldn't want to deprive you of the joy of doing that yourself :) | |
Re: If your program has to do file i/o or displaying something on the screen then it has no choice but to call win32 api functions to do that. 32-bit programs can not access hardware unless its a kernel level program. | |
Re: line 116: variables x and y have not been initialized to anything. | |
Re: [URL="http://en.wikipedia.org/wiki/Greatest_common_divisor"]This wiki article [/URL]tells you how to derive the gcd. Pay close attention to the section about the Euclidean algorithm. | |
Re: There are pros and cons to that. Pros: the program will be a lot faster at startup con: the file can't be easily changed. If you need to change something (i.e. add or delete info) then you might have to write a small conversion program that converts the data from … | |
Re: see the functions in time.h, specifically localtime() or gmtime() |
The End.