15,300 Posted Topics
Re: [QUOTE=moshw;610317]Hi, I'm learning C++ programming and have to write a program that shows how to calculate tax rates for a business tha th as shops in 3 different cities with three different tax rates, using the printf function. Anyhelp I can get is appreciated. Keep in mind I am just … | |
Re: do you mean the sort function beginning on line 84 ? Lines 97-100 look ok to me. | |
Re: [QUOTE=tubatsimoloi;592941]Please help me!! I recently finished my C#.Net course, and need to start writing programs. But now the problem is, I honestly don't know where and how to start. Please advise me!![/QUOTE] I hop you mean you want to start writing programs for profit (e.g. professionally). Have you got your … | |
Re: [b]it[/b] is a pointer [icode] Animal *x = *it;[/icode] [icode]x->passTime();[/icode] | |
Re: How to save the game depends on how the program is written. Since thre are over a gzillion ways to write a game its impossible for anyone here to tell you exactly how you do it. But lets say your program has two variables that need to be saved and … | |
Re: You could use a std::vector, or std::list, or write your own linked list. If that isn't what you want then we have no idea what you mean. | |
Re: Don't expect any mod to answer questions via PM -- we don't. Post all questions on one of the DaniWeb boards. And I moved this thread to a more appropriate board. | |
Re: Does anyone do that any more? I thought they were made obsolete by the cell phone and satrllites. | |
Re: Those ACM links are probably pretty useless to the OP. Not unless he has a Masters or Ph.D. in computer science or something which I doubt. | |
Re: To be be frank I think you are about 10 years too late to be starting a new career in computer programming You might be able to find an intro position somewhere but companies will want to hire much younger people with no experience. I actually begam mine when I … | |
Re: Sorry for this diversion, but I read the thread title and couldn't help but thik of [URL="http://www.imdb.com/title/tt0085450/"]Dr. Detroit[/URL] movie :) | |
Re: use the time() function if you only want accuracy to the second, of clock() for milliseconds. [code] const time_t MaxTime = 60*60; // one minute timer time_t t1 = time(0); // start the timer bool done = false; while( !done ) { time_t t2 = time(0); // get current time … | |
Re: OMG am I happy that I use Microsoft Visual Studio. All that makefile stuff makes my head swim. :) | |
Re: Then don't do that :) Don't put any code in the program that accesses the file system. Simple. | |
Re: >> I'm more of a visual baic & c# man, and wish my project would let write it in VB or C# This is [b]c++ board[/b]. If you want vb or c# then ask your question there. >>String copsoutput; That needs to be lower-case s on string [icode][color=red]s[/color]tring copsoutput;[/icode] >>to … | |
Re: I would imagine that would depend on the operating system. Under MS-Windows programs can hog all the memory it wants (16-bit programs are restricted to 640K). AFAIK there is no way to restrict usage by a given program. | |
Re: If you are wanting to contain an array of unique random numbers, then [code] for each element in the array generate a random number search the array to see if the number already exists if not, then add it to the array otherwise, if it was found then go back … | |
Re: [QUOTE=jbennet;609843]when you click agree , its the same as signing a contract. You are legally bound by what you select.[/QUOTE] I'm not so sure about that -- how do they know who clicked on it? At most all they can tell is the ip address of the computer that was … | |
Re: Its just a normal text file, so just use standard stream io on it. Other than that advise its impossible for anyone to tell you more from what little you write. Sort of like walking into an auto repair ship and saying "My car doesn't work can you tell me … | |
Re: [code] struct MyParam_t { vector<double> *myvector1; vector<double> *myvector2; };[/code] Don't do that ^^^^ -- make the struct like you originally thought, see below. [code] struct MyParam { vector<double> myvector1; vector<double> myvector2; }; void fn(void *ptr) { MyParam*p = static_cast<MyParam*>(ptr); for(size_t i = 0; i < p->myvector1.size(); i++) cout << p->myvector1[i] … | |
Re: why not just put an int there, and you can juse use RECT instead of initRecArea [code] unsigned int cnt; for (next=45, cnt=48;next<=255;next+=30, cnt++) { OnCreate(hwnd,cs,RECT(205,45,55,20),(HMENU)cnt); } [/code] | |
Re: [QUOTE=Salem;609487] Use code=cpp .[/QUOTE] That doesn't work. Needs to be [noparse][code=cplusplus][/noparse] | |
Re: Upgrade to VC++ 2008 or use an earlier version of Access. VC++ 6.0 is no longer supported by Microsoft, and hasn't been for several years now. | |
Re: you can give it a default parameter of a blank string line 12: [icode] string ip_uri(string ip50, string uri50 = "");[/icode] | |
Re: [code] int try(int *add) { if(add()>10) try(sub); } [/code] That does work because the parameter to try() is not a pointer to a function. This should fix the compile error. [code] int try(int (*fn)() ) { if(add()>10) try(sub); } [/code] | |
Re: see [URL="http://www.codeproject.com/KB/docview/replacingview.aspx"]this article[/URL]. You should bookmark that site because it has a wealth of MFC code that you can freely use. | |
Re: If its already in std::string then use stringstream [code] #include <sstream> ... ... char Comma; std::string LineDummy; std::string text; int one = 0; int two = 0; std::string MainLine = "Hello,1,2"; stringstream str(MainLine); getline(str,text,','); str >> one >> Comma >> two; cout << text << " " << one << … | |
Re: put the numbers in an array [code] int array[3] = {3,1,5}; int largest = array[0]; int smallest = array[0]; for(int i = 1; i < 3; i++) { if( array[i] > largest) largest = array[i]; // now do similar for smallest } [/code] | |
Re: I don't recall seeing that problem, just [URL="http://www.daniweb.com/forums/thread124648.html"]the one I reported.[/URL] Maybe the two are related ???? | |
Re: [code] for(i=0; i<M && !fp1.eof(); i++) { for(j=0;j<N !fp1.eof();j++) { fscanf(fp1," %f", &a[i][j]); } } [/code] or something like this [code] i= 0; j = 0; while( fscanf(fp1," %f", &a[i][j]) > 0) { j++; if( j == N) { j= 0; i++; } } [/code] | |
Re: My guess is that neither of those loops will work. 1) how is iter_vsDirectory initialized? You failed to post it. 2) what is the purpose of that first loop with the iterator ? The iterator doesn't appear to be used anywhere within the loop. Adding more strings to the end … | |
Re: If you are using cout then you can use setw() [code] #include <iostream> #include <iomanip> using namespace std; int main(int argc, char* argv[]) { cout << setw(10) << "Hello"; return 0; } [/code] | |
Re: There is no difference between structures and c++ classes other than default access. Unions are the same as they are in C -- all members of a union occupy the same memory location. >>classes and their associated components are instantiated in memory in pretty much random order, but structs and … | |
Re: If it worked in Turbo C it was because you were lucky. [b]header[/b] is an unallocated pointer. Since it is in global space the pointer's value is initialized to 0 during the program's startup code, which is executed before main() is called. The program crashes because you need to call … | |
Re: maybe you should read [URL="http://cs.uccs.edu/~semwal/indexGLTutorial.html"]a tutorial[/URL] | |
Re: Convert the dates to time_t using struct tm in <ctime> then you can easily compare the two dates without any problems. Or, you can rearrange the date so that they are in the form YYYY/MM/DD then you can use normal string comparisons on the dates. >>So is it possible to … | |
Re: I never use the else in a statement like that. But there really is nothing wrong with it because a good optimizing compiler will probably delete the else anyway. | |
Re: system("\"D:\\Program Files\\Internet Explorer\\iexplore.exe\" 192.168.23.5"); | |
Re: >>wat i wanted is that it if the row binary wif the bits Stop writing like this is some chat room. It isn't. Spell out the words. | |
Re: [QUOTE=xyster;608806] I wrote this intending it to be either able to swap a structure, or just the data defined within a structure. Will the swap function be able to do this, because.. when i tested it, it seemed to fail. but i didnt except it too. [/quote] It fails because … | |
Re: >>Could it be compatability issue btn Vista and Visual 6.0 Yes. Toss that compiler out and upgrade to VC++ 2008. The Express edition is free, but doesn't support MFC. | |
Re: I think the process that creates the shared memory must stay alive until all other processes are done using it. When the creating process dies the os deletes the shared memory. [URL="http://www.cs.cf.ac.uk/Dave/C/node27.html"]Here is a description for Solaris[/URL], which is probably identical to the work I've done with IBM unix. But, … | |
Re: I don't need no stinking "stupid test" to prove I'm stupid :) | |
Re: [list] [*]Eating ice cream for 24 hours without gaining weight. [*]Learning to play a musical instrument such as piano in 24 hours. [*]Spend the day at a health club without getting too exhausted. [*]Be the President of USA for a day. [*]Fly to UK and spend the day in London. … | |
Re: [code] if ( !fout.fail() ) { // if began fout << p->Objperson.nombre << endl; fout << p->Objperson.ss << endl; fout << p->Objperson.edad << endl; } // if end [/code] That should be a while loop. Also your program will be a little more efficient if you do not use endl … | |
Re: [URL="http://www.google.com/search?hl=en&q=online+university+degrees"]see these google links[/URL]. Make sure whatever you decide to do that the course(s) are accredited. Talk to your school counseler about whether the courses are transferrable or not because many of them are not unless you get the bachelor's degree with that institution. | |
Re: line 8: you might as well delete it because the compiler will delete it when you compile the program for release mode. Instead of using assert, just test as normal [code] if( !foud.is_open()) { // open failed } [/code] line 10: don't use eof() like that because it doesn't work … | |
Re: look at line 13 of the *.cpp file then compare it with line 30 of the header file. The first parameter of the function in the *.cpp file does not match the parameter in the header file. Also, the cpp file must declare the class name [code] void [color=red]Football::[/color]SearchMatches(Match* matches,int … | |
Re: How exactly does the code you posted attempt to solve the problem ? Answer: it doesn't -- the code is for a completly different homework problem. Do the requirements one at a time. Your first task is to create a structure that contains three items: last name, first name, and … | |
Re: [QUOTE=The Dude;601067]Hehe thought other things @ first :D (Then realized the staff would hit clicked DELETE THREAD if it was that) Very nice regardless........[/QUOTE] I did just that, then realized what it was about so I undeleted it. |
The End.