15,300 Posted Topics

Member Avatar for jalpesh_007
Member Avatar for Peter_morley

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]

Member Avatar for Peter_morley
0
238
Member Avatar for ramkumar0022
Member Avatar for jasleen12345

>>#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++) …

Member Avatar for Ancient Dragon
0
122
Member Avatar for Tusike

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]

Member Avatar for Ancient Dragon
0
129
Member Avatar for CodyOebel

>>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 …

Member Avatar for LevyDee
0
166
Member Avatar for kk33

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.

Member Avatar for kk33
0
227
Member Avatar for WHITE_BOLT

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 …

Member Avatar for Adak
0
119
Member Avatar for danijela123

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.

Member Avatar for Ancient Dragon
0
265
Member Avatar for Ami_m24

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.

Member Avatar for Ancient Dragon
0
130
Member Avatar for widapol

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 …

Member Avatar for widapol
0
633
Member Avatar for tommyz4

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.

Member Avatar for Ancient Dragon
0
268
Member Avatar for muze

@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]

Member Avatar for Ancient Dragon
0
137
Member Avatar for CodyOebel

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]

Member Avatar for CodyOebel
0
151
Member Avatar for pavangajula2007

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]

Member Avatar for Ancient Dragon
0
41
Member Avatar for Chris Nicola

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 …

Member Avatar for Chris Nicola
0
146
Member Avatar for onako

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 …

Member Avatar for onako
0
277
Member Avatar for vbx_wx

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 …

Member Avatar for Ancient Dragon
0
32
Member Avatar for Rebelkid

[URL="http://www.precisesecurity.com/files-process/2010/08/13/winconfig-js/"]Its a virus -- read this[/URL]

Member Avatar for Ancient Dragon
0
116
Member Avatar for namehere05

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.

Member Avatar for namehere05
0
1K
Member Avatar for gavindoc

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 …

Member Avatar for Ancient Dragon
0
207
Member Avatar for utkarsh009
Member Avatar for Ancient Dragon
0
80
Member Avatar for Jixz

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 …

Member Avatar for Ancient Dragon
0
137
Member Avatar for rstinejr

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 …

Member Avatar for Ancient Dragon
0
105
Member Avatar for owenransen

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 …

Member Avatar for Ancient Dragon
0
167
Member Avatar for erin2010

Welcome to DaniWeb. Interesting -- how did go from electronics to patient research?

Member Avatar for erin2010
0
98
Member Avatar for D4Stone
Member Avatar for cableguy31

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 …

Member Avatar for cableguy31
0
215
Member Avatar for dennis.d.elston

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 …

Member Avatar for litsluv
0
247
Member Avatar for Ancient Dragon

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.

Member Avatar for Nick Evan
0
154
Member Avatar for koti86

You mean you can't send/receive files using Windows Explorer? If not then how are you trying to do it?

Member Avatar for Ancient Dragon
0
53
Member Avatar for praky

Probably this [URL="http://www.boost.org/doc/libs/1_43_0/libs/dynamic_bitset/dynamic_bitset.html"]boost library[/URL]

Member Avatar for Ancient Dragon
0
49
Member Avatar for jrgoh
Member Avatar for utkarsh009

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 …

Member Avatar for Ancient Dragon
0
218
Member Avatar for nerdthon123

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\

Member Avatar for Ancient Dragon
0
140
Member Avatar for Vllinator

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()

Member Avatar for Ancient Dragon
0
167
Member Avatar for Vllinator
Member Avatar for kuchick32

>>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);

Member Avatar for Ancient Dragon
0
114
Member Avatar for notmasteryet

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]

Member Avatar for Fbody
0
357
Member Avatar for GDICommander

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.

Member Avatar for GDICommander
0
103
Member Avatar for aviavyne

>> 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 …

Member Avatar for Fbody
0
320
Member Avatar for Eagles36

>>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 …

Member Avatar for StuXYZ
0
178
Member Avatar for VernonDozier

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.

Member Avatar for Ancient Dragon
0
1K
Member Avatar for jos_t_tarigan

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); …

Member Avatar for Ancient Dragon
0
204
Member Avatar for Win Myat

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 :)

Member Avatar for Dazaa
0
7K
Member Avatar for abdelhakeem

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.

Member Avatar for abdelhakeem
0
114
Member Avatar for apautz22
Member Avatar for apautz22
0
885
Member Avatar for itiwcsingkaww

[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.

Member Avatar for nbaztec
0
194
Member Avatar for Talguy

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 …

Member Avatar for Talguy
0
87
Member Avatar for cableguy31
Member Avatar for Ancient Dragon
0
147

The End.