15,300 Posted Topics
Re: >>it gave me runtime error everytime I compi Impossible. Compiling a program can not produce runtime errors-- such errors are called [b]compile time errors[/b]. Only running the executable program can product [b]runtime[/b] errors. If that compiler gives you so much grief why use it? Toss it into the bit bucket … | |
Re: [QUOTE=iamthwee;439051]It is also quite possible that Ancient Dragon edited so it has lost its original meaning.[/QUOTE] Nope. I didn't change the actual content of the post, just added code tags around that triangle to retain the spacing. | |
Re: you can't. files know nothing about colors and fonts. The best you can do is use some sort of color tags that is recognized by the program that reads the file -- for example Notepad doesn't recognize any, but the browser might if you use color html tags. ![]() | |
Re: The only thing I know about Holland is that they have lots of tulips and hills. | |
Re: There's not that much of a difference -- one is a member of a c++ class and the other isn't. [code] #include <iostream> using namespace std; class MyClass { public: void operator<<(std::string str) { cout << str;} std::string SayHello() {return "Hello\n";} }; // non-member operator ostream& operator<<(ostream& stream, class MyClass& … ![]() | |
Re: Instead of attempting to change the size of the terminal (not sure that is even possible) figure out how to align the data correctly. That will probably require knowledge of and use of terminfo information because every terminal may be different. | |
Re: [QUOTE=sutherlin;436208]i need help[/QUOTE] counjure up a 4-year-old thread then post some irrelevant crap -- yes you do need help. | |
Re: UNICODE is the default setting for that compiler so if you didn't turn it off then the compiler is mapping TCHAR into wchar_t. go to Project --> Properties (bottom menu item) --> Configuration Properties --> General then change [b]Character Set[/b] option to [b]Not Set[/b]. If you really do want UNICODE … | |
Re: Are you using MFC or pure win32 api? My best suggestion for you is to download the several example programs you can find with google and try them out. Nothing helps one understand a problem like practicle demonstration. | |
Re: If Order can contain one or many pizzas then it should have a vector of pizza objects, and pass the Pizza object by referenct so prevent unnecessary duplication of the object. [code] class Order { public: void addPizza ( Pizza& order) ; void outOrder ( ) ; private: vector<Pizza> theOrders; … | |
Re: [URL="http://discuss.fogcreek.com/joelonsoftware/default.asp?cmd=show&ixPost=862"]This[/URL] is an interesting thread that talks about command-line compiles | |
Re: strstr() expects the first parameter to be a char* pointer, not a std::string object. use the c_str() method to get the pointer [code] strPtr = strstr(phone_book[index].c_str(), lookup); [/code] But you don't need to use strstr() at all because std::string has a lookup function called find(). It returns an int to … | |
Re: where is what wrong? Do you get compile errors ? If yes, then post some of them. Sorry, but I don't have my crystle ball with me today :) | |
Re: No need for doubles here -- you can use int for both hours and minutes, use the mod operator to get the number of minutes left over after getting the hours int hours, minutes_late; hours = minutes/60; minutes_late = minutes % 60; Lets say that minutes = 62. hours will … | |
Re: [quote]If the first sequence of non-whitespace characters in str does not form a valid floating-point number as just defined, or if no such sequence exists because either str is empty or contains only whitespace characters, no conversion is performed[/quote] [url]http://www.cplusplus.com/reference/clibrary/cstdlib/strtod.html[/url] From the above I don't think the value of the … | |
Re: >>How are an object’s data members initialized if a class has only an implicitly defined default constructor They aren't initialized -- they contain whatever value happens to be there at the time the class object is instantiated. That's the purpose of writing your own constructor. >>And why a class might … | |
Re: you could have read it directly into the integer [code] long next4; fileopen.read (&next4, sizeof(long) ) ; [/code] or you can use the assignment statement [code] int main() { char next4[4] ; int num; while(!fileopen.eof()) { fileopen.read (next4, 4 ) ; num = *(int *)next4; } } [/code] A third … | |
Re: line 16 is not needed because the file pointer is always set to beginning of file when the file is opened -- line 12. line 17 is an infinite loop because lines 19 and 20 reset the file pointer back to the 4th byte in the file on every loop … | |
Re: This is the sort of program where a structure or class comes in handy -- makes sorting the data a whole lot simpler. [code] struct bowler { string name; int score; }; [/code] >>However, I want to change it where the "int score" is, so that the user can input … | |
Re: line 5 should be [inlinecode]delete[] Entry[/inlinecode] | |
Re: >>And the immigrants that have made the USA great are those that chose to join the melting pot, not those who chose to make the melting pot join them! That's true for the most part -- but there other groups scannered around the country who choose not to fully integrate … | |
Re: Your code is missing closing brace and semicolon at the end of the class declaration and before main() on line 58. After correcting that you can probabably figure out how to correct the other one million errors. | |
Re: [QUOTE=cscgal;435593]But then it wouldn't be able to be opened by any Windows machine.[/QUOTE] Not correct -- most of the c++ header files do not have extensions and are read/written ok with most windows compilers and text editors. File extensions are not enforced by MS-Windows os. However -- if we're talking … | |
Re: If you are that new to c++ then there is no way you can complete that project right now. Learn the language first by reading some introduction to c++ books or eboks. Read through the [b]Read Me[/b] threads at the top of this board for lots of good links and … | |
Re: >>Why does my program stop after the validation Because you didn't tell it to loop back to the beginning of main(). If you want the program to execute all that code again you have to put the code in a big loop. My suggestion is to put it in another … | |
![]() | Re: It is also used by programs when executing other programs. The return value tells the calling program whether it successfully executed its job or not. The return value is useful in a lot of situations, even in Windows programs. |
Re: [QUOTE=starjsjswars2;435065]hmm... but what i mean is in the command prompt i tpye in C:/programfiles/blahblahblah so i hit enter. it opens the .exe. So when i hit the arrow up botton it has the same cmd in it.. so what i wanna do is have that arrow go up and exeute … | |
Re: >>int HotDogStand:: totalSales = 0 ; this line goes into a *.cpp file, not the *.h file because it actually declares an object. | |
Re: count the arguments -- the function at the bottom of your code has 12 arguments but the function prototype at the top has only 9 arguments -- they are not he same function. | |
Re: you can also find the maximum values in the header file limits.h -- and most 32-bit compilers today support a 64-bit integers, such as __int64 (Microsoft compilers) or [b]long long[/b] other compilers. >>does this 4 billion refer to the numbers in quantity or the amount of numbers I can put … | |
Re: [QUOTE=StrikerX11;434640]You may use the system function![/QUOTE] That might work with *nix, but not MS-Windows. | |
Re: Its ok because string literals are in the heap and not the stack. However, because the function is returning a string literal the return value should be declared as [b]const[/b] keyword. [code] const char *throwstring(); [/code] [b]main()[/b] should be declared as [b]int main()[/b] and not leave it up to the … | |
Re: >>There are many places where being off by just 1 character can radically alter the behaviour of a program OMG its sooo true, I've had that happen all too often. | |
Re: >>please help me for solving my problem. I'm absolutly frustrated now Not possible if you don't post the code. | |
Re: >>Any heads up message would help me out Yes -- read whatever manuals the manufacture publishes because there is no standard way of doing it. Some even provide SDKs, some are free and others aren't. | |
Re: without the CD, you will probably have to take it back to the store where you bought it and have them reinstall vista. Or try [URL="http://www.microsoft.com/windows/shop/upgradenow.mspx"]this[/URL] | |
Re: >>cannot boot into harddrive what do you recommend Reformat the hard drive with a low-level formatting tool then reinstall the operating system and all other programs that you lost. Or you could do what I did once -- toss it out the back door and smash it into millions of … | |
Re: [URL="http://developer.sonyericsson.com/message.jspa?messageID=99352"]Read this[/URL] I found with google. Apparently that compiler is for a mobile computer, but I don't know for sure. My guess is that you can forget nearly everything you know about Turbo C++ when working with that compiler. It's a whole different world when working with embedded compilers. | |
Re: Also we normally discourage the use of scanf() with"%s" because it will allow you to corrupt the program's memory by scribbling outside the boundry of the arrays. For example if [b]make[/b] is declared as an array of 10 characters and you type 15 characters then scanf() will write the extra … | |
Re: you need to put the information in the input files into one vector, then sort the vector, and finally write the vector contents to the output file. From the example files you posted this will be fairly simple. You can use std::sort to sort the vector after reading from the … | |
Re: win32 api has functions to parse them. Don't know about *nix. Also, see [URL="http://www.codeproject.com/useritems/SimpleIni.asp"]this article[/URL] | |
Re: Is the server checking the status of the socket connections before attempting to use them? | |
Re: [QUOTE=jarv;432885]i am using Vista Ultimate, does this matter?[/QUOTE] No -- that error has nothing at all to do with the operating system. Without seeing your code I guess that you left out a semicolon somewhere. | |
Re: We have no clue what you are asking. Please explain in greater detail and post some code if you can. | |
Re: you header file need code gards to prevent that, like this [code] #ifndef MYHEADER #define MYHEADER // code goes here #endif [/code] ![]() | |
Re: The solution is to make sure you coded that function with exactly the right parameters (in your case the function does not have any parameters). If there is a [b]OnBnClickedBackBtn[/b] function make sure it contains the class scope [b]CTryDlg::[/b] (Been there and done that mistake too). | |
Re: If you use a compiler such as VC++ 2005 (Pro edition) or eVC++ 2.0, or eVC++ 3.0, or eVC++ 4.0 you can have it generate the MIPS assembly code. >>and print anapshot of the registers and the results Not sure how to do that because the value of the registers … | |
Re: Is the husband of a woman who is President still called The First Lady ? | |
Re: [URL="http://www.phim.unibe.ch/comp_doc/c_manual/C/FUNCTIONS/getchar.html"]getchar[/URL] is the standard C library function. Borland compiler has many functions that have no standard C library equivalent, such as everything in graphics.h. |
The End.