15,300 Posted Topics
Re: So what is the problem? Out of energy? What is that supposed to mean? And the program just goes to the Game Menu because that's exactly what you told it to do (line 35). | |
Re: Isn't cheating exactly the cause of our global financial crises were are now in? Whats-His-Name started a pyramid scheme that cheated thousands of people out of several Billion dollars? I read an article in local newspaper about a woman in Missouri who did a similar thing but on a much … | |
Re: Just count the lines as they are being read [code] std::string line; int counter = 0; while ( getline(myfile, line) ) { ++counter; cout << left << setw(4) << counter << line << "\n"; } [/code] | |
Re: video tutorials are next to worthless. Why? Because its nearly impossible to reference certain material without viewing the entire video! Lets say you are confused about loops, and loops are discussed near the end of a 2-hour video tutorial. Well, would you rather sit there a watch the entire tutorial … | |
Re: Any reason you posted that code, which can not be compiled with anything but Turbo C compiler? | |
Re: [URL="http://lmgtfy.com/?q=how+to+create+a+makefile"]try this[/URL] | |
Re: You put the guards in the *.h files that you wrote, not the STL or other system files. If you are getting errors, then you didn't do it correctly, and you should post the header file w/guards so we can see what you did. [code] //"xmlParser.h" #ifndef XMLPARSER_H #define XMLPARSER_H … | |
Re: >>char* delString(char s1, char s2) those two parameters are wrong. They should be std::string, not char (which is just a single character) | |
| |
Re: [QUOTE=Icebone1000;826116]Hi again I opened the new file with word pad, the problem is theres a lot of memory junk being writed on the end of the file (ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ...) lots and lots Any idea of what can I be doing wrong? [/QUOTE] You aren't doing anything wrong. You can't view binary … | |
Re: you have to create one big string that includes all the variables [code] #include <iostream> using namespace std; int main(int argc, char *argv[]) { string ip string command; cout << Enter an ip; cin >> ip; command = "ping " + ip; system(command.c_str()); //// this is the problem. how do … | |
Re: delete and delete[] don't erase the memory locations, only frees it up for other uses as Narue previously said. The data you stored at that location is still there, but delete invalidated the pointer you had. Its always a good rule-of-thumb to reset pointers to NULL after calling delete or … | |
Re: Probably a permissions problem. When doing backups, what account is the backup program running under? It needs to run under an account that has admin permissions on your XP computer. | |
Re: The COM object I worked with return HRESULT and the BSTR was a parameter [code] BSTR b = 0; HRESULT hr = ComObject->Foo(&b); [/code] But you have to check exposed function prototypes in the COM object's header file. | |
[URL="http://www.metacafe.com/watch/716168/beethoven_morse_symphony/"]Beethoven Morse Code Symphony[/URL]. Sorry about the short commercial at the beginning. | |
Re: can you use the functions in time.h? If you can, just populate a struct tm, call mktime() to get the time_t object. Once you have the two time_t objects call difftime(). | |
Re: line 59: why are you attempting to so math on std::string objects? test1 and test2 are std::strings, you can't divide them by 2 then multiply them by 2 like that line is attempting to do. | |
Re: all boost libraries have to be compiled on the target machine. [URL="http://www.boost.org/doc/libs/1_38_0/more/getting_started/windows.html"]See this link[/URL]. That is one way they ensure portability. >>Can I simply make a copy of the .hpp file to the project dir, or are boost file too much interrelated? No. You have to build the libraries on … | |
Re: did you [URL="http://lmgtfy.com/?q=C+program+for+audio+compression+and+decompression%3F"]try this?[/URL] | |
Re: line 22: fgets() doesn't return '\n'. [URL="http://www.cplusplus.com/reference/clibrary/cstdio/fgets.html"]Read this[/URL] . If the line read contains '\n' then the last character in the input buffer will also be '\n' and in that case you need to strip it off if you want the line to be useful. [code] if( stg[strlen(stg)-1] == '\n') … | |
Re: what compiler and operating system. It could be a limit of your os and/or compiler. Try your program on a 64-bit os, such as 64-bit XP or Vista and see if that fixes it. | |
Re: you need to write an event handler for each of those buttons. Inside the event handler is where you put the code to load and display the image you want. As I recall, to create an event handler function for a button just right-click the button and you will see … | |
Re: >>is it a big task? Yes -- Microsoft has been developing theirs for some 20 years now. >>can anyone explain me or direct me to a concept that explains this? Just buy the educational version (I assume you are a student, so you are eligible for huge discounts), install, and … | |
Re: what includes are you using? maybe one of them also includes string.h | |
Re: Theme from piano concerto no.1 , peter Tchaikovsky, for guitar [url]http://www.youtube.com/watch?v=mCLAAAoqhcQ[/url] | |
Re: Read [URL="http://www.codeproject.com/KB/threads/winspy.aspx"]this article[/URL] | |
Re: You have to read the manufacturer's programmers manual, or call them and ask them. | |
Re: I started a new empty windows project, pasted your code and it compiled without any errors or warnings. When you created your project did you create a console project or windows project. It must be a windows project. | |
Re: maybe you need to rearrange the program so that it does this [code] Do you want chocolate, vanilla or twist? chocolate hot fudge, chocolate or strawberry sauce? hot fudge Do you want sprinkles (yes/no)? no You ordered chocolate ice cream with hot fudge sauce without sprinkles. Press any key to … | |
Re: [QUOTE=Narue;826340]>int size=0; >int *parr= new int[size]; For starters, size isn't a compile-time constant, which means you're relying on a compiler extension and your code is thus non-portable [/quote] I think you just had a brain fart :) There is nothing wrong with calling new with a non-const integer. Maybe you … | |
Re: Its not necessary to initialize std::strings with blanks because that is the default. Just declare them like this:[icode]std::string softserve, topping, sprinkles;[/icode] I think your program needs more cin statements for data entry. | |
Re: I have no idea, but start [URL="http://xerces.apache.org/xerces-c/mailing-lists.html"]here[/URL] | |
Re: [QUOTE=Oufrelax;826160]Invision Power Board is a good one, it's also got a lot of free add-ons to add just about any feature you could want. but a Permanent License costs $130. ^^;;; Demo : [url=http://www.forumotion.com]free forums[/url][/QUOTE] vBulletin isn't free either. | |
Re: From [URL="http://secondlife.com/whatis/"]this[/URL], it looks like a game of some sorts to me. | |
Re: You can use the division operator / to extract the number of hours and minutes. How many seconds in an hour? How many in one minute? 8230 / (60 * 60) = number of hours | |
Re: use static allocation unless (1) your os and compiler have very limited stack space, or (2) the objects are huge. Declaring STL containers like vector dynamicall is just a waste of time/effort because they only consume about 20 bytes of memory anyway. | |
Re: Vista has changed a lot of things, one of them is it won't run the graphics programs produced by the old Turbo C compilers. You have to use a new compiler and use normal win32 api graphics functions which are NOT GBI. So you have to just forget everything you … | |
Re: There is no ansi c standard way of flushing the input stream. fflush(stdin) is compiler specific becaue fflush() is only guaranteed to work on output streams such as stdout. If you want a non-standard way to do it you could use fflush(stdin) or functions from conio.h such as [code] while(_kbhit() … | |
Re: >>if (currentfile == "instance") currentfile is an ifstream object, so it can not be compared to a string. Do you mean filename instead of currentfile ? If yes, then you will have to use strcmp() to compare the two character arrays. | |
Re: you obviously are not using MS-Windows or *nix operating systems, because the max amount of ram supported by 64-bit MS-Windows is 128 gig. one way to do what you want is to store the data in two or more arrays and use one of the arrays depending on the value … | |
Re: integer digits are also characters. For example '0', '1', '2', ... '9' are all ascii characters just as 'a', 'b', ... 'z' are ascii characters. Its quite easy to convert an ascii numeric character to an integer -- just subtract '0' [code] int x = '0' - '0'; // result … | |
Re: >>Create a 2d array called alpha with dimensions 5x208 that will contain alphabet characters i.e. That is asking you to create a 2d character array that can contain 5 strings and each string can contain up to 208 characters. Like this: [icode]char alpha[5][208];[/icode] | |
Re: >>it should yield a result of product as gud [b]gud[/b] is not in any English language dictionary that I know of, so I have no idea what you mean by that. >>I need a c++ program dealing with sales and marketing First you need to define the problem better. What, … | |
Re: moved. You didn't say what programming language so I assumed C. Next time don't post tech questions in Geek's Lounge. | |
Re: I tried compiling that with vc++ 2008 Express, and the Microsoft compiler hates it. It doesn't like the "c\n\t" part. | |
Re: 1) it goes negative because there is nothing to prevent it. Its an infinit recursive function -- that is until it consumes all available stack space and then it will simply crash. You need to add a line that stops the recursion when x == 0 (or whatever other value … | |
Re: 1) get rid of strcmpi() C function. See my version of the == operator below. 2) add [icode]#include <algorithm>[/icode] for the transform() function 3) The friend function is not part of the class, so it has to reference the SortedListNode by SortedList::SortedListNode [code] #include <iostream> #include <cstring> #include <string> #include … | |
Re: you mean something like this? [icode]char array[16384][8][/icode]? What is a w64 structure? | |
Re: line 14-17: where SMALL, MEDIUM etc defined ? I think you need to declare just one int variable that can contain the enum variables SMALL, MEDIUM ... [code] enum sizes {NO_SIZE, SMALL, MEDIUM, LARGE, XLARGE}; sizes shirt_size = NO_SIZE; ... if (WEIGHT <=135) shirt_size = SMALL; else if( WEIGHT <= … |
The End.