15,300 Posted Topics
Re: Your program does not include <string> for std::string class, so how in the world are you getting it to compile????? Don't attempt to execute a program that contains compiler errors or warnings. Yes, warnings in your code are usually errors too. | |
Re: [b]Location:[/b] My Town near St Louis Illinois [b]price in gallons:[/b] $2.05 (USD) $3.05 (AUS dollars) The price of gas is now 1/2 what it was a year ago. | |
Re: we don't do people's homework, but we will help if you show is some effort on your part. Post the code you have attempted and ask more specific questions. | |
Re: USA citizens do NOT cast votes for President/VP candidates. They vote for electors [url]http://en.wikipedia.org/wiki/U.S._Electoral_College[/url] [quote] Rather than directly voting for the President and Vice President, United States citizens cast votes for electors. Electors are technically free to vote for anyone eligible to be President, but in practice pledge to vote … | |
Re: put the code in a library or DLL than only distribute the lib or DLL along with the header file(s) that declares the function prototypes to the users. That is the common way to do it. Example: all the win32 api functions are in DLLs or libraries. | |
Re: [url]www.codeproject.com[/url] has thousands of free programs, code snippets and libraries for MS-Windows. | |
Re: lines 26-31 are in the wrong order. Move them between lines 16 and 18. You have to validate the file is opened before you can read it. If that still doesn't fix the problem then I suspect the file is not where you think it is. On line 14 use … | |
Re: C is probably a better language than C++. Lots of operating systems have been written using C. >>The next question I have is where to start. [URL="http://www.google.com/search?hl=en&q=how+to+write+an+operating+system&aq=f&oq="]Here are some google links [/URL]you should read | |
Re: you will have to use some sort of gui libraries and/or compiler. Depends on your operating system. | |
Re: [QUOTE=johnray31;730733]What is the reason that compiler will not detect this error if it is not in single file?[/QUOTE] You got it! The compiler only works with one *.c or *.cpp file at a time and creates object code files such as *.o and *.obj. Its the linker that puts the … | |
Re: What do you mean "it didn't work" ? Do you take your car to the repair shop and tell the repairman "it doesn't work" ? You have to be a lot more descriptive of the problem, and post an example project. | |
Re: Is that even possible? How can a computer program know if sound is actually coming out of the speakers or not? But maybe there's some interface with the sound card API that will indicate that ??? | |
Re: [quote]Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and not clothed. Dwight D. Eisenhower [/quote] That's not true -- war boosts our economy. Who do you think makes … | |
Re: [QUOTE=sneekula;642449]I've been talking to Vicente Fox, the new president of Mexico ... to have gas and oil sent to U.S. so we'll not depend on foreign oil... --George W. Bush[/QUOTE] You mean Mexico isn't part of USA :) It might as well be, with all the illegals crossing the borders. | |
Re: Learning to spell and proofreading your posts would also be helpful. | |
Re: You could start by doing some of the exercises that people post here. Such as [URL="http://www.daniweb.com/forums/thread155587.html"]this one[/URL]. Read though the threads here and pick out a few programs that you think you can write. | |
Re: The attachment just consisted of a few useless characters. | |
Re: for a text file you just rewrite the file, leaving out the text you want to delete. | |
Re: Never heard of it. Good search indicates Prospero is a character in one of Shakespear's plays. | |
Re: You need to post the Queue class, especiall the enqueue() method. My hunch is that it does not make its own copy of the Customer class, but just uses the same pointer that is passed to it in the parameter. That's why it would wind up with all queue nodes … | |
Re: function prototypes normally are placed after all includes and before the first function. There are two ways (in C) and three ways in c++ to pass parameters. [list] [*] pass by value -- the object is just a copy of the value in the calling function. [*] pass by reference … | |
Re: If the path contains spaces then cin >> path will not work because >> stops at the first space. To use spaces call getline(cin, path) | |
Re: C and C++ are not the same language, so don't expect C compilers to act the same as c++. There are many differences that you will encounter. | |
Re: you don't initialize variables in header files becuse the variables don't exist. You have to declare variables in *.c or *.cpp files. You can, however, use the [b]extern[/b] keyword with variable in header files, but again they can not be initialized there. [code] // myheader.h file extern int myint; [/code] … | |
Re: You have to pay close attention to the compiler's error messages. Look at the first error message, the compiler will tell you which line the error is on. The list of errors may be different from compiler-to-compiler, so you need to tell us what compiler you are using and post … | |
Re: If you are using MS-Windows then use FindFirstFile() and FindNextFile() to get the names of all subdirectories, then recursively call the function to process the files in each subdirectory. I have posted a [URL="http://www.daniweb.com/code/snippet370.html"]code snipped that may help you here[/URL]. It will get a list of the files that you … | |
Re: some compilers complain if the last line of the file is not a newline. In the editor go to the last line and hit <Enter>. That should fix that warning. | |
[url]http://www.youtube.com/watch?v=aQd0ELH7SNI[/url] [url]http://www.youtube.com/watch?v=p-12Xo-U90Q&NR=1[/url] [url]http://www.youtube.com/watch?v=9g8Ja9-ergI&mode=related&search=[/url] | |
Re: Dude -- I should give you bad rep for wasting so much of my time :) | |
Re: I heard about this on talk radio station this afternoon. Votors need to watch what happens very carefully. I trust those electronic voting machines even less than the paper ones (hanging chads). | |
Re: Did you near Obama change the level from $250 to $120 ? I didn't. So that republican spear campaign add it just so much crap because they know they are really desperate. | |
Re: you need to learn how to create event handlers, which are functions that you write that MS-Windows calls then someone clicks on a menu item or button. | |
Re: >> getline(istream& fin, string& num_of_isbn, char '\n'); That is a function prototype, not a function call. As written, it will do nothing. If you want to actually call getline() then you need to change it to this: [icode]getline(fin, num_of_isgn); [/icode] -- Not the '\n' parameter (last parameter) is not needed … | |
Re: There are many ways to implement it, [URL="http://www.codeproject.com/KB/files/Sample_INI_File_in_C.aspx"]here is just one of them[/URL]. If you want to store information in the registry instead of ini files then [URL="http://www.codeproject.com/KB/system/NtRegistry.aspx"]here [/URL]is a good c++ class, although there are many others. | |
Re: I don't think there is any set rule -- depends on the message. Look at the message description in MSDN. Some say to return TRUE if you want to base class handler to be called, or FALSE if you don't. Also, in some cases you may want the base class … | |
Re: The function arguments must be the same type. f and g take an int, while h takes a char. | |
Re: You are using a Microsoft compiler, and it creates projects that, by default, use precompiled headers. If you want to use precompiled headers then the very first include file must be stdafx.h [code] #include "stdafx.h" // other stuff here [/code] If you don't want to use precompiled headers then go … | |
Re: The stat() or _stat() function will also validate the existance of a file and will return some information about the file | |
Re: I know with MS-DOS 6.X and earlier it was possible to do that pretty easily with assembly code, but for console windows in MS-Windows I don't think it is possible. If you have a win32 GUI program then you would implement [URL="http://msdn.microsoft.com/en-us/library/ms997557.aspx"]scroll bars[/URL] You might also check out some of … | |
Re: try starting a new console Hello World project and see if it links ok. It that's ok then add the files in the project that gives you the problem. | |
Re: That's because you enclosed the \0 in double quotes. Change it to single quotes [icode]pPtr->myArray[127]= '\0';[/icode] If myArray is less than 128 bytes then the above will cause buffer overflow. | |
Re: >>What I couldn't figure out is how to find the word's location in a line According to the description of the program you posted all you need is the line number, not the location within the line. For line numbers, just use an integer to keep track of them. You … | |
Re: Ask Narue -- she told me awhile back that she collects old computer books. | |
Re: You posted your assignment and code, so what now? Are we to just admire the code you posted? | |
Re: >>I am new to C++ and am not currently in a class teaching it OpenGL requires at least a basic understanding of c++. So if you don't have that then wait until you have completed a couple semesters of c++ or read/studied the textbook. No one here is even going … | |
Re: typecast each character, such as [code] std::string x = "guy"; cout << (int)x[0]; [/code] Now, just put that in a loop, replace the 0 in [0] with loop counter and you have it. | |
Re: The argument to XStart.exe contains spaces, so you need to wrap double quotes around it. See red [code] _tcscpy(tszCommandLine, _T("C:\\Program Files\\Hummingbird\\Connectivity\\12.00\\Exceed\\Xstart.exe [color=red]\"[/color]C:\\Documents and Settings\\username\\Application Data\\Hummingbird\\Connectivity\\12.00\\Profile\\XSW3.xs[color=red]\"[/color]")); [/code] | |
Re: The two tests you posted look like two different directories -- they are not even close to listing the same files. |
The End.