15,300 Posted Topics
Re: First off, that is a C program, not a C++ program. To fix the errors, declare manager* outside the switch statement. It does no good to declare the pointers like you did because they do nothing and are destroyed as soon as the break statement is executed. | |
Re: You said it yourself: Here 'MediumIndication', is a Class, 'mi', 'cs' are object of a class, 'subcribe' is a function, 'getParentModule()', 'getId()' are functions. droppedPacket is also an object of a class. 'bb' is a pointer to a class. I hope it is now clear to you. What more do … | |
Re: I think you have to rearrange this into polish notation. For example, if I enter "100 + 2" when the + operator is reached your program attempts to pop two values off the stack, then in fact there is only one value (100). | |
Re: [QUOTE=alishujahx;966407]I will give you lessons in english and then some assignments. And we will use Microsoft Visual C++ 6.0 as IDE! [/QUOTE] That's a terrible idea:icon_eek: Why not use VC++ 2008 Express, which supports c++ a lot better than that old vc++ 6.0 compiler. Otherwise, I applaud your efforts to … | |
Re: you don't really need the at() method, just index it just like an ordinary array [icode]if ((setlist[i]==true) && i != setlist.getLargest()[/icode] Notice that method getLargest() does not take any parameters. Also note that getLargest() will return the index value not a value from the array. | |
Re: If it is a character array then use the functions in string.h header file. strlen() returns the length of a character array while strcmp() compares two character arrays. | |
Re: what compiler are you using? If it has a debugger then learn to use it so that you can find out what is wrong with your program. | |
Re: you could use 1) ncurses or 2) vt100 mode api calls. There are probably other ways too, such as termcap | |
Re: [b]My Favorite Forums[/b] ??? Yes I like that too. Also like the new rep counters. | |
Re: maybe you need to force the message box to be repainted. | |
Re: Yes, it will compile both C and C++ programs. Just name the file with *.c extension and it will be compiled as a C program. | |
Re: I wouldn't pay much attention to that article -- pirated copies are probably very buggy. I will wait until I get my hands on the real thing before making any pronouncements one way or the other. | |
![]() | Re: What's the problem? just replace that static text with a wchar_t* variable [code] TCHAR buf[] = L"lars"; hWnd = CreateWindow( L"3ngine", buf, WS_OVERLAPPEDWINDOW, xPos, yPos, xSize, ySize, NULL, NULL, wc.hInstance, NULL ); [/code] ![]() |
Re: Every program must have one [b]main()[/b] function. The code you posted does not have that. | |
Re: The instructions seem pretty clear to me. Just do them one at a time, from top to bottom. Do the first requirement, compile, fix error messages, then when that is finished do the next requirement. | |
Re: That's what C language was supposed to do too, but it doesn't because programs like to interface with the operating systems and the hardware. That makes them os/hardware specific which require program changes when porting from one os/hardware configuration to another. I would expect Voyager 7.2 Pervasive Software Platform to … | |
Re: An integer can be treated as either decimal, hexadecimal, or octal. As far as the program is concerned they are all the same. Its only us humans who know the difference when they are displayed, such as `cout << hex << number << '\n';` | |
Re: You don't because that compiler is too old. | |
Re: Which do you want, a C solution or C++? And what have you tried ? | |
Re: >>I seem to recall I had to include iostream.h to use the CString class. Do I have that right? No. You need to create an MFC program or a console program that supports MFC. The IDE will generate the files with necessary includes, such as afx.h. 1) There is no … | |
Re: I think it could be done pretty simply like this: [code] template <class elemType> void arrayListType<elemType>::removeDups(const elemType& removeItem) { int loc; for( loc = 0; loc < length-1; loc++) { if( list[loc] == removeItem) { removeAt(loc); --loc; // repeat last test because item has moved } } } //end remove … | |
Re: 1. That program is not using a "random access file". Those kinds of files are binary files with fixed-length records. What you are doing is sequential access file -- reading from beginning to end in an attempt to find a given record, and the records may or may not be … | |
Re: Multiple lines of code within if statements must be enclosed in brackets { and } [code] if( condition ) { // do this // do that } else { // do something else } [/code] | |
Re: The value 0xcccccc usually is an uninitialized or bad variable. Its not likely that its the compiler difference, but, if the control is a licensed control then I suspect because the DLL was not installed properly on your computer. If that's not the case then I have no idea about … | |
Re: >>I am not sure if i am doing it right, of if i am just way off. Can someone help me? Didn't you run the program? If not, why not ? Don't ask us if your program will work or not -- you can find that out by yourself by … | |
Re: [URL="http://lmgtfy.com/?q=how+to+write+a+compiler"]Start here [/URL]to learn how to write a compiler. If you can not do that simple task then writing a compiler is not for you. | |
Re: >>The problem is that i cant select which one. Whether Visual C or JAVA or python .. "Visual C" is not a language -- its just the name of a compiler. You can use it to compile both C and C++ programs. Why do you have to choose just one … | |
Re: And use code tags -- see that link that says [b][noparse][code][/noparse][/b]? That wasn't put there just for decorations. | |
Re: [URL="http://msdn.microsoft.com/en-us/library/ms794193.aspx"]read this article[/URL]. You need to download the Windows DDK. | |
Re: many floating point values can not be represented exactly in memory due to the way they are stored. For a complete explanation [URL="http://en.wikipedia.org/wiki/Floating_point"]read this wiki article[/URL] which will probably tell you a lot more than you dared to know. | |
Re: [QUOTE=sweetsympathy17;1005890]aahahaha! im not really in on reading rules [/QUOTE] Than I can't be bothered to help you. | |
Re: I think you mean nested menus. [code] void menu2() { // do some menu stuff } void menu1() { // display a menu switch (selection) { case 1: menu2(); break; // other choices follow } } [/code] | |
Re: Stop flooding DaniWeb with that same question. Read the responses you have received in your original thread. | |
Re: One problem with your program is that the value of MAX may or may not be big enough. If I enter the value 10 then MAX is too large because 10 in binary is only 4 digits (1010). But if I enter the value of 123456 the binary value is … | |
Re: Happygeek is a really big tweetgeek :) I suspect he spends most of his time searching blogs. | |
Re: you have to use pointers to pointers (double stars) [code] const int dataSize1 = 5; const int dataSize2 = 6; void LoadData(char** file, float** data1, float** data2) { // read data size and contents from file *file = new char[255]; strcpy(*file, "This is a test"); *data1 = new float[dataSize1]; *data2 … | |
Can you put a time limit on voting, such as when a time expires then no more votes are possible? Six months seems a reasonable limit. I have seen some of my very very old posts (2-4 years) with votes. The same for applying rep should also apply. | |
Re: you have to completly rewrite the file, omitting the string you want deleted. | |
Re: >>Basically the please hit any key to enter doesn't show up in Visual C++.Thanks for help Because you didn't tell it to say that. When you run the program from the IDE, that message appears because the IDE told it to. When you run the program from the command-line that … | |
Re: line 18 has two parameters, line 26 only has one. Never put the function implementation code into a header file because the linker will report duplicate declaration errors. | |
Re: Next time use code tags when posting code. That [b][noparse][code][/noparse][/b] link isn't just to make DaniWeb pretty. | |
Re: [QUOTE=RossSCann;1004335]Thanks, I will research that process. How does one gain a trusted certificate?[/QUOTE] Read the link! | |
Re: AFAIK we were never able to list just the solved threads. The best you can do is list all the threads that you posted in and the ones you started. | |
Re: >>while(strcmp(&cmd, "end") != 0) [b]cmd[/b] is declared as a single character, therefore the above line, as well as all other similar lines, are just horseshit. A single character can not contain a string, and any attempt to pass a pointer to a single character to any string handling function such … |
The End.