15,300 Posted Topics
Re: Read newspapers, see headhunters, ask friends/family | |
Re: Compilers are free to choose to ignore the inline keyword or not. Move the code in test2.cpp to test2.h since you use the linline keyword, then delete test2.cpp from the project. | |
Re: why are you using malloc() in a c++ program -- malloc() doesn't know how to allocate c++ objects? Use the [b]new[/b] operator instead. And you can not use the delete operator to free memory that was allocated by malloc(). delete only works with new. | |
Re: Do the requirements just one at a time so that you don't get too confused and overwhelmed by the size of that assignment. Don't try to code it all at one time either -- code a few lines, compile, make corrections, compile again until no more errors. Then code a … | |
Re: you can't input and output to the file at the same time without some very fancy footwork by repositioning the file pointer to the beginning of the file before the write. The way I understand what you want, the file only contains one line of text, which you want to … | |
Re: If you know you want exactly 20 bytes from incoming data then your program should just wait until it gets all 20 bytes before proceeding. That means it will have to sit in a loop waiting for incoming data at the port. The input buffer should be just an unsigned … | |
Re: I have no idea why it can't run -- are you trying to run it on the same operating system that you compiled it on -- such as compile on MS-Windows and attempt to run on *nix :) If you expect an answer you need to ask a more detailed … | |
If anyone can answer [URL="http://www.programmingforums.org/thread16958.html"]my question on PFO [/URL]I'd apprecaite an answer. I don't want to repeat it here because it is somewhat lengthy. | |
Re: For other than English characters you should compile c++ programs for [URL="http://unicode.org/standard/WhatIsUnicode.html"]UNICODE[/URL]. Exactly how to do that is compiler dependent. | |
Re: 1) Are you going to tell us what your instructor wanted you to do, or do you expect us to read your mind ???? 2) You need to make the test immediately after the line [icode]cin.ignore()[/icode] to prevent the rest of the code incide that loop from executing. | |
Re: Or you could just simply open the file in your program, read each line, search for the keyword then increment a counter when found. A pretty simple program to write if you already know file i/o functions. If you don't then this is a good opportunity to expand your knowledge … | |
Re: post the line of code that gave you that error. If you want that function to allocate the memory for the pointers then the pointers will have to be passed by pointer, not by value [icode]void fbExeCode(int BldCnt, char** fbCodeAddr, char** tempAddr)[/icode] -- note the two stars. You will have … | |
Re: line 32: you can't typecast ascii to unicode. should be something like this: [icode]LPCTSTR name= _TEXT("mydata.txt");[/icode] | |
Re: The return type of line 8 and 43 must be the same. The same with the other function. Change the return type of functions prototypes on line 8 and 9 to void and your problem will be solved. | |
Re: The difference is how you want to view the array. Bla[64] is just a one, dimensional array that contains a simple list of items, for example you could have an array that contains a list of 64 varieties of fruits and vegies. The Bla[8][8] is an two dimensional array, such … | |
Re: >>The only thing I can figure is that it starts counting at 1 instead of 0 a No, arrays are always numberd beginning with 0. The a+5 in line 9 that you posted is 1 element beyond the end of the array, which satisfies the [b]end[/b] statement that you posted. … | |
Re: you could do something like this, assuming you don't need to keep all the names in memory at the same time [code] int count = 0; infil >> firstStudent; while( infile >> lastStudent) count++; [/code] | |
Re: AFAIK there are no laws that require people to notify DMV when they move. So IMO purging people whose address doesn't match the DMV database is just silly, and very probably illegal, and apparently the Attorneys General of those states do too. But theres a dillema: how can states legally … | |
Re: Those symbols are in different fonts, which require a GUI program such as M$ Word or your browser to display them. Can't use them in normal console programs. | |
Re: I would also ditch the MFC file handling classes such as CFile and CArchive, but use normal standard c++ fstreams and std::string, which are a whole lot easier to use. That assumes you are using a compiler that supports fstreams and std::string -- some embedded compilers do not. | |
Re: Welcome to DaniWeb. You need to make a post in our [URL="http://www.daniweb.com/forums/forum133.html"]Project Partners Wanted[/URL] board. | |
Re: Go get professional help -- we aren't qualified to give you the help you need. | |
Re: resolved with the [icode]using [/icode] clause, such as [icode]using namespace std;[/icode]. Alternatively you can just put the namespace when you declare the object, such as [icode]std::string mystring;[/icode] or [icode]mynamespace::myobj obj;[/icode] | |
Re: 40% Republican and 36% Democrat. So I guess that means I'm 24% Libertarian. | |
Re: [URL="http://www.daniweb.com/search/search.php?q=pointer+tutorial"]Seek and thou shalt find.[/URL] >>How do we know the type the pointer points? You have to declare the data type when the pointer is created. [icode]int* iPointer;[/icode] >>Is it compiler specific? No. Pointers are defined by C and C++ standards, so all compilers comply. | |
Re: Maybe its a compiler debugger bug -- I used VC++ 2008 Express and the CLR version displays the values the same way your link shows for the win32 console program. | |
Re: after entering an integer the program leaves the '\n' in the keyboard buffer. When the next getchar() is called it gets that '\n' from the buffer instead of waiting for user input. To correct this add getchar() after scanf("%d", &consump); | |
Re: 1) Can I assume you have not tried to compile the code you posted? Or that you just ignored all compiler errors ? (Hint: Line 73 is wrong) If you can print the information correctly using cout then you can print the same thing using any ofstream object -- cout … | |
Re: If you only want something done on Saturday (when dow == 6) then write a bit of code that will call Sleep() and put your program asleep for 24 hours, then check again. Make sure the program waiks up again at midnight so that the next checks will work. Once … | |
Re: Nobody can help you if you don't post the code. Maybe your recursive function didn't know when to stop and cause stack overflow or something else just as bad. Check to see if there is something in the function that will make the recursion stop. Also make it stop after … | |
Re: 1) gets() -- never use it. [URL="http://www.gidnetwork.com/b-56.html"]Read this [/URL]for explaination of why. lines 26-27: There is no need for variable x. Just use the parameter variable n. line 41: >>void putdata(int n); Delete that line because its not necessary to prototype a function before actually writing the code for it. … | |
Re: First write a program that compiles another program, probably by calling make.exe, nmake.exe, or some other such program that does command-line compiles on your computer. That will be the easiest part because all your program is doing is apawning another program. The more dificult part will be running the test … | |
Re: You can't put it in DLLMain() because just like any other function the object will disappear as soon as DllMain() returns. Instead, the object must be global. Then to make it visible to the application program you have two choices: 1) use __dllspec(__dllexport) tag [icode] __declspec( dllexport ) const char … | |
Re: You can't use malloc() to allocate c++ objects like std::string, but use the new operator. This is more than likely the cause of your program crashing. | |
Re: It seems to me that's a pretty serious flaw. I wouldn't touch Chrome until after it comes out of beta because its hard telling what else it might do to my computer. | |
Re: My guess is that the program needs to reinitialize some variables. But you can almost always avoid using the goto statement at all [code] bool done = false; int response; while( !done ) { response = menu(); if( response == 2 { done = true; } else { // initialize … | |
Re: That compiler is not fully c++ compliant and contains several bugs. If you want to compile that then you may have to use a different compiler. >>Also check the options of your VC6.0 to make sure that it is pointing to the correct include, lib and bin directories. I tried … | |
Re: For the benefit of non-Americans, Senator Harry Reed (in the interview) is just flat wrong -- our taxaction is NOT voluntary and people have served prison time for not paying taxes. We can not tell our employers not to deduct taxes from our salary, nor can employers decide not to … | |
Re: Homework -- we don't do people's homework. You write and ask questions -- we answer them. | |
Re: >> include <inomanip> That file doesn't exist either. It's misspelled. | |
Re: A static class variable is like an ordinary global variable but has scope only within the class. Like global variables, there is only one instance of a static variable regardless of the number of instances of the class. >> it complains about missing Count in DLListNode class... Because you also … | |
Re: Instead of just asking us to do your homework for you, post what you have done and find out how to make it work the way you want it to work. | |
Re: First you have to decide which computer language you want to learn. There are several languages that you can use to write application programs. If you want to write GUI programs than probably VB.NET is good to start -- you can download a free compiler from Microsoft. | |
Re: use DirectX -- it has a bouncing ball example program (or it did some time ago) | |
Re: line 42: since the array temp was not initialized, calling strlen() will produce unpredictable and unreliable results. You don't want strlen() of temp but sizeof(temp) so that it can be used in lines 45 and 46. You can replace lines 42-47 with just one line [icode]char temp[251] = {0};[/icode] | |
Re: The way I understand it is all you have to do is create the functions you mentioned then move the code from the switch statement into the appropriate function, finally add function call inside the switch statement. Don't worry about menus etc until you get the hang of writing functions. … | |
Re: try this: [code] while (peopleCount < FINALPOP) { annualGrowth = annualPerc * INITPOP; peopleCount += (int)annualGrowth; // + INITPOP; yearsLeft = FINALPOP / (float)peopleCount; // peopleCount += peopleCount; cout << peopleCount << yearsLeft << endl; } [/code] | |
Re: My test reveals that I disagree with Obama on 63% of the questions, but I will vote for him anyway because there is no other choice -- McCain is just too old and I like his politics even less than I do Obama's. | |
Re: [URL="http://en.wikipedia.org/wiki/Haiku"]Poetry [/URL]is not normally spoken here. | |
Re: When I was young Art Linkletter had a weekly tv show Kids Say The Darndest Things. [URL="http://www.google.com/search?hl=en&q=kids+say+the+darndest+things&aq=1&oq=kids+say+the+"]Here are some links[/URL] YouTube links for your enjoyment. |
The End.