1,174 Posted Topics
Re: To have your code in e.g. a static library, create a new win32 static library solution. Add your files to the solution and compile. Now you have a .lib that you can ship along with your header file(s) for others to use. See Visual Studio's help on how to take … | |
| |
Re: Very shortly about the & operator, it is the bitwise and operator. See e.g. here [url]http://www.learncpp.com/cpp-tutorial/38-bitwise-operators/[/url] for details. | |
Re: Your catch statement in FuncB() is not setup to catch the specific exception that gets thrown from DoSomethingElse(), but the catch statement in FuncA() is. | |
Re: The error is not in your for loop, it is perfectly OK. You need to post some more code. | |
Re: It may prove helpful if you post the error messages that you are receiving. | |
Re: Here is one solution for your compareTo() function [code] int compareTo(const Record& r) const //2nd const wont change member variables { // first compare last names int result = strcmp(lname, r.lname); if(0 != result) { // last names differ return result; } // then compare first names result = strcmp(fname, … | |
Re: STL provides you with the reverse() algorithm. I.e. [code]std::reverse(your_vector.begin(), your_vector.end());[/code] You need to #include <algorithm> to make it compile. | |
Re: You can download dependency walker application from: [url]http://www.dependencywalker.com/[/url] Open your application in the dependency walker on your friends computer, that way you will see all the files that should be available but are not. You may have to install some redistribution package on your friends computer. | |
Re: Have a look at [url]http://www.daniweb.com/forums/thread108397-2.html[/url] | |
![]() | Re: Hmm .. shouldn't that first loop be something like [code] for ( int KPH = 50; KPH <= 130 ; KPH +=5) cout << setw (5) << KPH << "\t\t" << /* --- KPH converted to MPH here --- */ << setw(5) << endl; [/code] ![]() |
Re: >> Do have any idea about how you'd format a drive, without prompt Seriously, you must be kidding now asking for a thing like that ... | |
Re: To get rid of the compiler errors, first remove the items in [COLOR="Red"]red[/COLOR] [code] void sort(Student stu[], int parameter, int count) { <snip> for (int i = 0; i< count-1; i++) { [COLOR="Red"][79][/COLOR] if(Student[i].compareTo(Student[i+1], parameter) == true) [COLOR="Red"][80] [/COLOR] { <snip> } } } [/code] and then change the [code] … | |
Re: Try this one, it displays four different styles messages, maybe you get the idea of how message boxes work. The last one prompts you with a question. [code] #include <windows.h> int main(int argc, char* argv[]) { MessageBox(NULL, "Serious error", "<Message title here>", MB_ICONSTOP|MB_SETFOREGROUND); MessageBox(NULL, "Warning", "<Message title here>", MB_ICONEXCLAMATION|MB_SETFOREGROUND); MessageBox(NULL, … | |
Re: You don't see the name because the code does not output it anywhere, you must add [CODE]cout << name;[/CODE] at a proper location. | |
Re: First of all, you have there two 'main' functions, one for a windows graphical interface application and one for a console application. You only can have one of them, not both. I think you can remove the WinMain() function altogether and use just the 'int main()'. Actually the main function … | |
Re: << Given the file example name of "dafile". Here the name is [B]dafile[/B] << system("del dafile.txt"); And here the name is [B]dafile.[COLOR="Red"]txt[/COLOR][/B] Do you have a file named 'dafile' on your desktop and you are trying to delete 'dafile.txt', which does not exist? | |
Re: A minor note ... I think that actually if(doc==EOF)break; is OK since the compiler is to promote the char to int for the comparison. | |
Re: All the for loops use an upper limit of 100 but you only have 20 elements in intNum.RatNo[], that's why it fails. | |
Re: [CODE] float CelsiustoFahrenheit(int) { // // This fails because you are dividing using two integers here, // // result = ((9/5)*temperatureC)+32; // // use the following instead // result = ((9/5[B].0[/B])*temperatureC)+32; return result; } [/CODE] You might want to run the following snippet to see the difference [CODE] cout << … | |
Re: Hi, I quickly changed the code so that it should do what you intented. [code=c++] #include <iostream> #include <cmath> using namespace std; int calcRval(int,int,int); // the input to colCode() is now a char int colCode(char); // these variables are not needed // int c1,c2,c3,val; int main() { char c1,c2,c3; cout<<"input … | |
Re: Hi, How about just forgetting the Get/SetWindowxxx functions and use something like ... SendMessage(edit_control, WM_CHAR, achar, 0); | |
Re: [QUOTE=hyperzero4;536523] Everything seems to be going okay... except for the last part when I'm trying to get the word_appearances to count how many of the search words are in the poem written inside script.txt. [/QUOTE] You need only two for() loops to iterate over the strings i.e. something like below. … | |
Re: [QUOTE=Prahaai;536437] I don't understand how this program acts as a COM application, that's the problem. [/QUOTE] Well, you tried to run it as a .COM but you did not compile it first. Any file with the extension .com is a candidate to be run as a program under windows. Windows … |
The End.