150 Posted Topics
Re: [b]if the program TEST.ASM has been designed as an EXE program , can the program TEST.OBJ be executed successfully[/b] No. Object files are simply a binary image of what the compiler determined is the most appropriate interpretation of source. You must then take that/those object files and link them together. … | |
Re: CreateFont as 14 parameters that need be passed to it, and it will provide you with everything you need to create the font you need. | |
Re: When you created this project you may have inadvertantly selected of the 15 choices the wrong type. In your case [b]Win32 Console Application[/b] would have been the one you wanted. There are also several other settings that could have been corrupted, so the simplest thing to do is create a … | |
Re: There are subtle differences between these two methods, so you may want to check out in detail which one suites your purposes. In any case either will work.[code]SendMessage (hWnd, WM_SETTEXT, 0, char *);[/code]or[code]SetWindowText (hWnd, char *)[/code] | |
Re: Put all your printf() back in, take out one at a time and then you'll know exactly where the problem is. | |
Re: XP/NT/2000 have restructured the way DOS works, and many people have complained too that after installing SP2, QBasic and other programs won't work. Virus writers have depended extensively in the past using DOS and more particularly dropping into BIOS to circumvent kernel code. | |
Re: [quote=purplefantasy]I have finish but I couldn't calculate and it not work[/quote]Show us what you've got done so far, so we know what to tell you to correct. | |
I'd like to read a floating point value [b]cin >> Value [/b]where Value is declared as a double and then output it to a string justified to two decimal places. I understand how to do it using a temporary file, but I'd like to avoid that method and [b]sprintf() [/b]if … | |
Re: That's a pretty loaded question. Qualify first how you want to do it, meaning are you going to use a resource or create the dialog directly within code. Which compiler are you using now. If it's VC++ then are you using MFC. It might be an idea to post something … | |
Re: You've got the right idea, now it's just a matter of deciding what sort algorithym you want to use. Conditionals "if" would work, especially as there are only three values but you might not want to limit your application to this. Consider declaring you inputs as an array of int's … | |
Re: First thing I saw was you mixed a little basic with C.[code]while ((strcmp(dummy,"ZZZZZ") !=0) [b][u]&&[/u][/b] (i<maxrows));[/code] not [b]and[/b]. Other than that you were so close. All you needed to do was make another loop inside your do loop[code]strcpy(place[i],dummy); for (int x = 0; x < 12; x++) { fscanf(fp,"%f",&rain[x]); printf("[b]\n\t[/b]%10s\t%2.2f", … | |
Re: Try this baboon4000. 1. Create a table of 26 elements (A - Z) 2. Everytime you use a letter check the value of the corresponding element of the array and if it hasn't been used yet invert its state. To tell you the truth, it probably took you longer to … | |
Re: Provide a little detail as to how far you've gotten with your code so far. Basically, you are going to respond to that windows WM_LBUTTONDOWN event. Then you can use GetWindowText (hWnd, lpstr String, length of string), provided window was created with "BUTTON" class. | |
Re: Technically C++ and XP/98 Linux OSX Unix are not an intregal part of one another. C++ is just merely a tool by which you can write applications for many platforms. The scope an purpose to your classes would have been gaining knowledge how to use the language effectively. Just because … | |
Re: [QUOTE=Narue][code] 21 10 3 13 2005 12 8 4 9 2004 3 6 10 31 2004 [/code] Say you want to change 12 8 4 9 2004 to 12 8 4 11 2004[/QUOTE]Wouldn't the resulting string being 1 byte longer overwrite the "3" in the next position (record)? Often when … | |
Re: What is the error? Right off hand I can see you are mixing two entry points. void main () & WinMain. WinMain is empty. There is an example of a sekeltal app in code snippets under cplusplus. Look at that one and it will give you a good idea how … | |
Re: [QUOTE=F50]if ((fin[j]==false) && (nd[j] < ava[1]))[/QUOTE]Your function definition declares "ava" as an it, but your trying to use as if it was an array. This wasn't too hard to spot, but in the furture please include everything so it can be pasted into compiler without modification. | |
Re: Linux[code]#include <sys/stat.h> mkdir (const char *path, mode_t mode);[/code]in this case mode = O_CREAT. Function returns an int. Lookup "man mkdir", if memory serves me correctly for more details. Windows[code]#include <windows.h> CreateDirectory (char *DirName, SECURITY_ATTRIBUTES Attribs);[/code]If the function succeeds returns non-zero otherwise NULL. | |
Re: I'm not at my own computer so I can't test the code, but the idea is to steer you in the right direction anyway. If you have the pro version of VC++ have a look at the disassembled code. You'll see why I let the switch statements fall through the … | |
Re: Start with this[code]char *Units [] = {"One","Two","Three","Four","Five","Six","Seven","Eight","Nine"}; char *Teen [] = {"Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"}; char *Tens [] = {"Ten","Twenty","Thirty","Fourty","Fifty","Sixty","Seventy","Eighty","Ninety"};[/code] After you get your input cycle through all the characters and determine which string corresponds to the numeric input. I already have this program done in it's entirety as part of a check … | |
Re: Get rid of Norton, it causes nothing but problems. Losing your mouse is the least of them. | |
Re: Yes you will eventually run out of memory by continuously allocating with malloc and never freeing. In the second case, theroetically you shouldn't run out of memory by freeing each time, but Linux and Unix like XP handle memory a lot better than 95 or 98 do. I have no … | |
Re: echo(), noecho(), cbreak(), nocbreak(), raw() & noraw() are the functions in ncurses you are looking for. If you are windowing with ncurses also read about keypad (WINDOW, bool) You can also do the same thing for terminals, but it's a little more convoluted than ncurses and it's the library I … | |
Re: Pointers and arrays of pointers are always problematic to understand, hopefully these changes will clarify for you.[code]#include <iostream> using namespace std; char *tarray [] = {"Alpha","Bravo","Charlie","Delta","Echo","Foxtrot","Gulf","Hotel", "India","Juliet","Kilo","Lima","Mike","November","Oscar","Papa", "Quebec","Romeo","Sierra","Tango","Uniform","Victor","Wiskey","X-Ray", "Yankee","Zulu"}; int main (void) { char phrase [80], holdPhrase [80], letter; cout << "Enter Phrase: "; cin.getline (phrase, 79); int sizeOfPhrase = … | |
Re: I don't think you'll find anyone here that will provide you with code right from scatch without you showing any effort at all. Post what you think you should do ([u][i]your code[/i][/u]), and I'm sure you'll find lot's of help from that point. | |
Re: It appears the problem is not with the code but rather the calculation of the offset "Total" or the position you eventually end up at in the file. Maybe OutputFile.seekp(Total,ios::cur); would solve the problem. Without seeing the contents of your file and associated code in its entirety it's really difficult … | |
Re: As defined in stdlib.h and malloc.h[code]free (q);[/code]will do the trick. Assure only pointers that were created with malloc, calloc or realloc are passed to free (), otherwise other calls to get memory may have unpredictable results. | |
Re: Fortunately all data is numeric, string or otherwise. Therefore casting a single element of SSN to int allows you to add that single byte to an integer as if it were original an integer. #include <iostream> using namespace std; int main() { int Result, Pntr; string SSN = "112226666"; Result … | |
Re: It looks as though you code is written for MASM Microsofts assembler. Absolutely, you can write an operating system using entriely assembly. Linux however has 95% of it written in "C", and even though I've never had the oportunity to look at other operating systems sources like Linux I would … | |
Re: Although [code]if (percent == 'n')[/code]is not incorrect, it is unusual though to compare a char against an int. In this case the only way this would be true if you entered 110 as lower case n has that value. Change your conditionals so you are comparing against numeric values[code]if (percent … | |
Re: DISREGUARD, You are using iostream and I'm not sure how that works with strings. You can't compare strings the way you do.[code] while (strcmp (filename, "quit") != 0)[/code] I think that should solve your problem. | |
| |
Re: By sounds of things you've sort of headed in the right direction with strcmp, and your ideas may not be as bad as you think. Give us an example of what you've come up with so far and take if from there. Remember to enclose code using code tags. | |
Re: [QUOTE=computerages] But the thing is that it has to be cross-platform and I just do not want to support Microsoft. [/QUOTE] I may be mistaken, but if you're going to interface with an Access database you'll probably be using Jet 3.6 which kills any idea of being cross platform. Maybe … | |
[b]kimfalk[/b] posed a question about static functions in a class in [url="http://www.daniweb.com/techtalkforums/thread19241.html"]http://www.daniweb.com/techtalkforums/thread19241.html[/url] to which my reponse was duly correct by [Quote=Narue]You're mixing up your statics. :) static is overloaded for too many different uses. In a class declaration, static means that the name belongs to the class and not to … | |
Re: Don't use static in a public class member. Public means it's accessable to the outside world, but static limits it too the segment of code where you've declared it. If you want to hide it from other peices of code put it in a protected or private section of the … | |
Re: I code all my Windows applications in ASM and have posted several snippets in the "asm" area that may be of some help to you. I use NASM, but MASM and the linker and resource compiler you are using will work just as well. | |
Re: Linked lists are very simple. Take for example a doubly linked list, it has a pointer to the previous item and one to the next. I use -1 or 0xffffffff to indicate the item is either at the begining or end of the list. Each time you insert a new … | |
Re: [QUOTE=Intel]The best [url="http://www.intel.com/software/products/compilers/cwin/"]http://www.intel.com/software/products/compilers/cwin/[/url] Good luck.[/QUOTE] Well I don't think this kind of rhetoric is appropriate for this or any other forum and I beleive when someone charactizes something as [b][u]the best[/u][/b] it's with the utmost sincerity and should be taken in that context. I have never used Intels compiler, but … | |
Re: [QUOTE=Dave Sinkula]struct node { int i; char c; }; struct node list[] = { {1,'A'},{2,'B'},{3,'C'},{4,'D'},{5,'E'},{6,'F'},{7,'G'},{8,'H'},{9,'I'}, }; struct node *plist[] = { &list[0], &list[2], &list[4], &list[6], &list[8], &list[1], &list[3], &list[5], &list[7], }; [/QUOTE] Nice Dave, I've been asked this question quite a bit and have never though of putting it together … | |
Re: In <stdio.h> you can use [b]fseek[/b] to move to the end of the file and then use [b]ftell [/b]to see where you are at, then [b]fseek[/b] to move you to the begining again. If you are using windows [b]GetFileSize (handle)[/b]. This method doesn't require you to move to be begining … | |
Re: Please post errors and warnings. We don't have to study code in that much detail with that information | |
Re: All you have to do is move or more specifically code appropriately in Vend::Vend ([i]default constructor[/i]) the values you want in fasm. This is how variables are initialized in a class, like int value [1][2] = {4, 8}; would be too code. | |
I'm enjoying this forum quite a bit. I was curious though, what qualifiies someone as a senior techie. I sure hope it isn't by the number of posts as this is the initial impression I'm getting. | |
Re: Usually I don't correct and repost code especially for assignments, but because you've got 95% of it right I see no harm. There were only two problems that I've seen that were C++ specific and that is failing to include iostream. Also wrong () and right () were declared as … | |
Re: Maybe try [b]C++ Primer Plus[/b], Sams Publishing [b][color=blue][u]ISBN 1-57169-162-6[/u][/color][/b]. It's a 1000 pages of excelent text with many good examples. I've found the "DUMMIES" series are just money makers and don't have very meanigful content. Most often the most itellegent people assume they are dummies and those books specifically written … ![]() | |
Re: I'm not familiar at all with Turbo C++, but maybe check the settings for the compiled application such as machine, stack, heap etc. It could be one of the parameters required by executable header is incorrect. | |
Re: There are many solutions to this problem, but I'm going to assume you are not using curses or terminal libraries. With gdb, break just after the getline (..) statement as see what the input buffer contains and then formulate your code based on that. For example let's say pressing F3 … | |
Re: What exactly are you entering at: [code] cin >> filename; [/code] If you are not specific ([i][size=1]entering drive designator[/size][/i]) it will use whatever the default drive is when the application was launched. Probably in your case "c:\". [b]winbatch[/b] is correct with his response, but don't make the mistake of doing … | |
Re: I don't have a specific answer for your problem other than when diagnosing, don't change so many things at the same time. Maybe go back to your old system, and if that motherboard has onboard video just use Power, Motherboard, Memory & CPU and then determine if you can get … |
The End.