15,300 Posted Topics
Re: I assume POS == Point Of Sale. You need to write a web site, not a c++ program. See Web Development forums. | |
Re: If the text file contains many user names and passwords then you have to completly rewrite the entire file in order to change just one of their passwords. [icode] Open the original file for reading Open a new temp file for writing For each line in the original file Read … ![]() | |
Re: Not sure what your asking. You have Form1 that invokes Form2 and you want Form2 to return something to Form1? | |
Re: >>Please see comments in code. Impossible. The code you posted is just formatted too awful. And the code tags are wrong. [noparse] [code=cplusplus] // your code here [/code] [/noparse] | |
Re: IMO the greatest advantage of getters and setters is that there is only one place in the entire program that accesses the class variable. If something has to be changed than you can change is in only one spot instead of hundres of places throught the program. Make the variables … | |
Re: The problem might be your isp -- I am running 64-bit Win7 and was able to connect to those sites (didn't try them all) In a command prompt try this: [icode]tracert [url]www.daniweb.com[/url][/icode] or any other site you want. | |
Re: It's also not portable -- can only be compiled with Turbo C. | |
Re: No. use POSIX sockets. The two are a lot alike so it shouldn't be all that difficutl to port from MS-Windows to *nix. | |
Re: prinf() doesn't work in Windows Forms applications because there is no console window for the text. | |
Re: Only the operating system can determine where a program is loaded because there are probably other programs in memory whose address may conflict the the one you specify. The program loader reads the program into memory, finds out where to store it, then resolves all program addresses to actual physical … | |
Re: [URL="http://en.wikipedia.org/wiki/Intel_Memory_Model"]Here [/URL]is a complete explanation if you're really all that interested. Applies to 16-bit MS-DOS compilers. If you want to port a 16-bit program to 32-bit compiler than just define FAR to be empty [code] #ifdef FAR #undef FAR #endif #define FAR [/code] You will want to do the same … | |
Re: or simplified like below. Note the function is unsafe, just like strcpy(), because it blindly copys the characters from one string to another without regard to whether the destination string is large enough to hold them all. A better solution to that problem is the same as strcpy_s() -- pass … | |
Re: You are reading the wrong tutotorial -- that was written for MAC, not MS-Windows. It's quite easy with VC++ 2010 Express or Code::Blocks, both compilers have start-up templates that generate appropriate code for you, then all you have to do is add your own code that you want to export … | |
Re: did you add the pdcurses library to the project? or usr a pargma to include them? such as [icode]#pragma message(lib,"pdcurses.lib")[/icode] in one of your *.c files. | |
Re: why is the sky blue? doubles have more precision than floats, and long doubles may or may not have more precision than doubles (compiler dependent). | |
Re: If you look in logmsgs.h you will probably find that function defined there. You can not put executable code in header files because it results in the error message that you got. Put just the function prototype in the header file and the actual function in one of the *.cpp … | |
Re: That's correct -- no 32-bit compiler supports GBI graphics. You can only use it with turbo c compiler. If you are trying to run turbo c on Windows 7 then you have to install [URL="http://www.dosbox.com/"]DoxBox[/URL] first, then run the compiler from within that program. | |
Re: The easiest way to validate addBalance is to get user input as a string instead of int. Then you can check each character of the string for valid digits. isalpha() doesn't work for you because the parameter to isalpha() is a single character, not an integer. Example: [code] std::string input; … | |
Re: If you use VC++ 2010 [code] void foo() { int x = 0; _asm { mov [x],1 } } [/code] | |
Re: step 3 will have to use floating point numbers because one integer divided by another integer will not produce any fractions. fmod() returns the remainder after division, similar to mod operator % for integers. So fmod(1.1234,1.0) will return 0.1234 | |
Re: bitmap.Save() does not take std::string as its first parameter. Did you try [icode]bitmap.Save(dir_save.c_str(), &clsid);[/icode] [URL="http://www.codeguru.com/forum/showthread.php?t=385375"]Here [/URL]is how to convert char* to wchar_t* | |
Re: Put code guards in timers.h fixed the problem for me. Note the preprocessor directives at the top and bottom of the file. This prevents the preprocessor from parsing the file more than once in the same *.cpp file. [code] #ifndef _TIMERS_H #define _TIMERS_H #include "includes.h" class servtime { public: int … | |
Re: You will first have to figure out what your widget needs to do then program it using very low-level GUI functions, on *nix using something like X11R6 or MS-Windows use win32 api graphics functions. This is not an easy task and not for the unexperienced. On MS-Windows it isn't as … | |
Re: Your program worked ok for me using vc++ 2010 express on Windows 7. But I don't understand why it contains a while(1) loop? One possible reason that it crashes on you is because the code never calls GlobalUnlock(). >>when I copy a file the program crashes Copy a from to … | |
Re: Why don't you just put both *.cpp files in the same *.so? | |
Re: >>We need to pass the logical drive letter before /Users and we need to pass the username in between /Users and /AppData. Well, that is pretty trival thing to do. Just create a std::string [code] std::string path; path = pch; path += "Users\\"; path += username; path += "\\AppData\\Local\\Microsoft\\Windows\\*.*"; int … | |
Re: If you hury up you can correect the code tags. [noparse] [code=cplusplus] [/noparse] Notice no spaces and its cplusplus not c++ Are you talking about converting UNICODE wchar_t* to char*? [URL="http://support.microsoft.com/kb/138813"]Here[/URL] is a thread that shows one way to do it. | |
At the bottom of my profile there are some links to the "Domains currently linking to this page". Where do you come up with all those links? Some are not valid links, another is Google's home page. Is there a way for you to verify those links once in awhile … | |
Re: Functions should never ever be in header files -- only function prototypes. The reason is if you have that header file in two or more *.cpp files then attempt to link those *.cpp files together you will get duplicate declaration errors. Here is how to correct that problem count.h [code] … | |
Re: [URL="http://www.google.com/search?source=ig&hl=en&rlz=1G1GGLQ_ENUS397&=&q=clr%2Fc%2B%2B+web+browser+control&aq=f&oq="]Here are a few links[/URL] that you should browse. | |
Re: line 147: why are you using variable limit in that loop? The value of limit could be any random number because its used in the previous loop as file input. >>Ok then could you give me some help as to how I can correct those errors? Make the two functions … | |
Re: >>How can I check if a user inputs a number other then numerical number display error and take him/her back to same question again? Get input as a character array insted of int then you can check for non-digit entries. If its ok then convert it to an int. | |
Re: you can expand ./folder into /home/user/folder by calling cwd(), assuming ./folder is the current working directory. Then you can compare the two absolute paths to see if one is in the other or that they are the same. You could produce the string ./folder from /home/user/folder, but it won't work … | |
Re: One possibility is that employee.bin file does not exist or is empty. You open the file in text mode but read it as if it were open in binary mode. On line 7 open the file in binary mode [icode]input_file=fopen("emp.bin","rb"); [/icode] You didn't post struct employee so we have no … | |
Re: name variable in Player class is an uninitialized pointer and the constructor does not allocate any space for it. Why don't you using std::string class instead of char* -- it will make your life a whole lot easier, your hair will not turn grey as quickly, and will greatly simplify … | |
Re: If you wrote the program then why don't you know about the username and password? | |
Re: What kind of tools do you mean? compilers, editors, project management, source code archivers | |
Re: >>The function should return the answer to main(), That means that the function has a return type that is NOT [b]void[/b]. The reason for the float typecasts below is to avoid the problems with integer division. With integer division all fractional parts are simply discarded, for example 1/2 is 0 … | |
| |
Re: you will have to keep track of where the '-' occurs -- it can only occur at the beginning of the text, no where else. AFAIK the '\b' will never ever be in the text box. Windows Forms text control will hangle back spaces for you. So you should never … | |
Re: 0x08 is a backspace 0x6d is the letter 'm' Don't you want something like if( Char::IsDigit(e->KeyChar) || e->KeyChar == 0x08 || e->KeyChar == '-') | |
Re: Where to begin what? If you want to know how to bake an apple pie then you are in the wrong place. | |
Re: You need to learn [URL="http://en.wikipedia.org/wiki/SQL"]SQL[/URL] and become intimately familiar with all the major databases, such as Microft SQL, MySQL, Oracle, and Sybase. You will have to know how to create datases, design them, how to use schemas, how to manage databases. [URL="http://en.wikipedia.org/wiki/Database_management_system"]Here[/URL] is a wiki article that gives much more … | |
| |
Re: deleted lines 5 and 9 because they serve no purpose and are probably screwing up the rest of your program. Also, make sure you close both files before leaving that if clause. | |
Re: Would you care to explain a little more what the problem is? You posted several while loops -- which one(s) is giving you the problem? | |
Re: Your suggestion is no different than Narue's. CreateFile() with CREATE_NEW will fail if the file already exists. Same, but opposite, behavior that Narue suggested. | |
Re: There really is no way to tell if the file is still opened other than attempt to open it in your program. If open fails, wait a little bit then try again. stay in that loop until open succeeds or some timeout value expires. | |
Re: How are you trying to display them? Are you compiling your program(s) with UNICDE enabled ? |
The End.