15,300 Posted Topics
Re: [QUOTE=joshmo;622741]if i may say..Actually maybe some people even code nude :)...just saying...it suprised me in this movie where some painter used to do his work bare(and that is how he could only do it) anyways hope its an entertaining idea..[/QUOTE] No way -- not in a roomful of other coders!:icon_eek: | |
Re: [icode] int c = (a * 10) + b;[/icode] | |
Re: Look at the [b]Rep Power[/b] you have -- its 0. You can not give green rep until you get it to 1. I think when you make 10 posts your rep power will go up to 1. | |
Re: >>when I try to #include afx.h so that I can build threads via AfxBeginThread I get the following error: why are you including afx.h ? If you are using a Microsoft compiler and using precompiled headers then that is already included in stdafx.h >>I was wondering if anyone could tell … | |
Re: Agree with Ed and Nick -- %p will display the address in hex values, while %u will display it as an unsigned integer. Which one to use really depends only on how you want to view the address. IMO hex is preferable. | |
Re: printf() can not be used to display text in a MS-Windows GUI program because there is no console window. Depending on your compiler the simplest way to test it is to compile for debug then set a breakpoint on the printf() line. Another alternative is to create a console window … | |
Re: You can not put MessageBox() or AfxMessageBox() inside event handler functions because they behave as you have found -- resursive. Its unfortunate, but that's the way MFC works. | |
Re: "%d" will produce decimal. If you want hex then use "%x" Try this: [code] int main() { char a[25]; int i; sprintf(a,"%x%x%x",0x0000001F,0x00000001,0x00271418); for(i=0;i<8;i++) { printf("%c\n",a[i]); } return 0; }[/code] | |
Re: WinZip -- which most everyone who does anything worthwhile uses ACD FotoCanvas Lite 2.0 -- open photos and scanned images so that I can convert them to another format CDBurnerXP | |
Re: Do the parameters print ok when coded like this ? I am assuming you are NOT compiling for UNICODE because if you were you would be getting other problems. [code] #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { for(int i = 0; i < argc; i++) cout … | |
Re: In MS-Windows you will probably want to have two threads -- one thread for dialing and the other thread to do other things. The Sleep(int milliseconds) is available from windows.h | |
Re: To get a single character you have to flush the '\n' character from the keyboard buffer. Here is one way to do that [code=c] #include <stdio.h> int main() { int grade; int acount =0; int bcount =0; while((grade=getchar())!=EOF) { switch(grade) { case 'a': ++acount; printf("account = %d\n", acount); getchar(); break; … | |
Re: Of course that is true -- In the USA they are called senators, congressmen, and lobbyists. | |
Re: Are you using *nix or MS-Windows ? If MS-Windows you can use FindFirstFile() and FindNextFile() to get the file names. See examples on MSDN and [URL="http://www.daniweb.com/search/search.php?q=FindFirstFile"]here at DaniWeb[/URL]. | |
Re: [QUOTE=GrimJack;629326]For you guys who have never had a suit fitted - the question "do you dress right or left" has to do with how you hang so the tailor know where to 'adjust' the fit of your trousers. But you probably knew that.[/QUOTE] I actually thought you meant "I dress … | |
Re: [QUOTE=daviddoria;629308] double Max(vector<geom_Point3> &Points, int n); min_x = Min(Vertices_, 0); [/QUOTE] Dave: Those are two different functions. Post the prototype for the Min() function, it apparently is different than for the Max() function which you posted. >>but then isn't it passing the entire array (which is very big in this … | |
![]() | Re: Do you mean this function? [code] void Weather::SetScheme(SceneArg *sceneArg) { memcpy(&mScheme,sceneArg,sizeof(SceneArg)); mIsLoaded = true; _update(); } [/code] The only problem I see in that function is that [b]sceneArg[/b] should be declared [b]const[/b]. Also check that it is a valid pointer. ![]() |
![]() | Re: Welcome to DaniWeb. >>Also, I really liked that you could donate me money in instructions that I give you Oh me too -- me too. :) |
Re: You could use a std::string for input then convert to double if its not "N". [code] void compute() { char firstExam; std::string input; double secondExam, thirdExam,avg; cout << "Enter the 1st test score (N to end): "; cin >> input; //firstExam; while (input != "N") { stringstream str(input); str >> … | |
Re: MS-Windows -- see these [URL="http://msdn.microsoft.com/en-us/library/aa363196(VS.85).aspx"]Communcations Resource Functons[/URL] If you read the links they will contain sample programs. | |
Re: When I was a kid growing up in central Iowa we called it pop. Where I now live we call it soda. I never did use [b]coke[/b] as a generic term for that substance. | |
Re: Override the OnCalcel() method in the dialog. The below code works from any dialog box within the SDI or MDI program. [code] void CAboutDlg::OnCancel() { CWnd* pWin = AfxGetMainWnd(); ::PostMessage(pWin->m_hWnd, WM_CLOSE,0,0); } [/code] | |
Re: Welcome to DaniWeb. Oh I envy your graphic talent :) | |
Re: Welcome to DaniWeb. You will get lots of help around here -- just ask away in any of the tech boards. | |
Re: Welcome to DaniWeb -- care to share other personal info with us, such as where you are from ? | |
Re: That is C++ code, not C. To compile with a C compiler you have to move line 7 to immediately after line 2. Why use a [b]do[/b] loop ? It does nothing at all. You can achieve the same thing if you delete lines 2 and 20. If malloc() fails … | |
Re: main() has two optional arguments that are the number of command line arguments and an array of strings are are the arguments [code] int main(int argc, char* argv[]) { } [/code] argc is always >= 1 because argv[0] is the name of the executable program. In your example [icode]joinTextFiles chapter1.txt … ![]() | |
| |
Re: [URL="http://www.winprog.org/tutorial/"]tutorial[/URL] download free [URL="http://cplus.about.com/od/learnc/ss/vc2008_2.htm"]VC++ 2008 Express[/URL] compiler or [URL="http://www.bloodshet.net"]Dev-C++. [/URL] | |
I've downloaded and compiled wxWindows using VC++ 2008 Express. Also am able to compile/link the Calculator example program (haven't tried the others yet). Now I want to begin writing my own program. So I searched google for tutorials to help get starte. None of them contain main(), and neither does … | |
Re: >> was wondering if anyone could provide any advice on how to create and use a dynamic library using gcc on Linux They are called [b]shared libraries[/b] on those operating systems. [URL="http://www.google.com/search?hl=en&q=how+to+create+shared+libraries+in+c%2B%2B"]Here are some google links[/URL]. | |
Re: >>How hard would that be? It may take anywhere from a couple days (for experienced programmers) to about a lifetime for beginners. For your compiler you might also want to download free wxWindows. Or if you want to use pure win32 api functions [URL="http://www.winprog.org/tutorial/"]here's[/URL] a tutorial. | |
Re: This isn't a porn site, so don't bet that something like that will get started. If you want a dating service then go to something like MySpace. | |
Re: [code] colHeadVector = new std::vector<QLabel*>(); //line 342 rowHeadVector = new std::vector<QLabel*>(); //line 343 widgetVector = new std::vector<std::vector<QWidget*>* >(); //line 344 arrayGrid = new QGridLayout(); //line 345 [/code] Why are those pointers? Just declare those vectors without pointers. You are not saving anything by making them pointers, instead you are creating … | |
Re: Microsoft discontinued that feature with 2005. It was replaced by VCBuild.exe, which uses the solution file. | |
Re: >> promise to have your babies OMG you are desperate aren't you :) >>The std::map in VC98 seems to be playing up Have you tried compiling and running with more recent compiler? That compiler is extremely old. Download VC++ 2008 Express and test your program. | |
Re: [URL="http://xerces.apache.org/xerces-c/"]Here you go.[/URL] | |
Re: Thanks to this thread I found out why Notepad was unable to save an existing text file. I kept getting errors that it could not save the file even though I read the messages carefully and answeres Yes to them all. After reading this thread I went to control panel … | |
Re: Welcome to DaniWeb Abbhie >>Eyes: black Are you sure? I never heard of a human with black eyes. You are human aren't you :) Maybe you mean you have [URL="http://en.wikipedia.org/wiki/Eye_color#Classification_of_colors"]grey eyes[/URL] ? | |
Re: Have you looked at the [URL="http://www.boost.org/doc/libs/1_35_0/doc/html/date_time.html"]boost libraries[/URL] ? I don't know if their time functions contain milliseconds or not. | |
Re: It compiled without error for me. What error message(s) did you get with your compiler. I used VC++ 2008 Express. | |
Re: did you try to find a solution using google ? [url]http://www.google.com/search?hl=en&q=play+movies+with+c%2B%2B&btnG=Search[/url] [url]http://www.astahost.com/info.php/how-play-videos-using-c_t11387.html[/url] | |
Re: Here is a simple example. You need to overload the [] operator, as below. [code=cplusplus] const int MAXSIZE = 20; class MyClass { public: MyClass() { x = 0; for(int i = 0; i < MAXSIZE; ++i) array[i] = i+1; } int& operator[](int n) {return array[n];} private: int x; int … | |
Re: The [b]for[/b] statement is actually explained on page 97. paragraph 6.5.3.3 shows the correct syntax. Without doing any research I'll bet there has been a later correction to 6.5.3.1 and what was shown at the botton of page 95. | |
Re: >>What usually be the cuase of the file reading the wrong data A bug in your program. | |
Re: Welcome to DaniWeb. I don't know the first thing about PHP but there are several other experts here that can help with your questions -- or you can help others with their problems. | |
Re: You don't put the function implementation code in *.h files then include the header file in two or more *.c files, or include it more than once in the same *.c file. That is what is causing the duplicate declaration errors. Put only the function prototypes in the header files … | |
Re: The comparisons are not limited to just one field within a class or structure, you can compare as many class objects such as strings that you want to. In the comparison, if the two names being compared are the same then compare the code. | |
Re: Now that you have posted your homework assignments, what are you asking from us ? |
The End.