15,300 Posted Topics
Re: Here is the output using VC++ 2008 Express on Vista. Is this the same as what you got? I'm sure the answers to your questions is how your compiler aligns data, on 1, 2, 4, 8 or 16 byte boundries. [quote] Here comes all the address listings: variable a: 26fe00 … | |
Re: >>I am not getting the results Not supprised because you can't return the array like that because it will disappear as soon as the function returns. There are a couple of ways to solve that problem: 1) add a parameter and have the calling program pass the input buffer [code] … | |
Re: >>Can anyone please tell me how to store contents of a text file after reading it into a 1D array buffer [code] char buf[1024]; // not read the file into the above array [/code] >>and then accessing each separate element of the paragraph C++ knows nothing about paragraphs -- only … | |
Re: you can export the entire class. I don't know if you can export boost library classes like this or not: [code] _dllspec(_dllexport) class A { // blabla }; [/code] | |
Re: >>Administrators , Moderators and all others who have a relationship have no right to answer . Ok -- stop me :) Don't know if they get any of the jobs or not since most people probably deal directly with the company offering the jobs rather then posting in DaniWeb. | |
Re: you probably trashed memory somewhere else before that line was executed. Most likely cause is writing beyone the bounds of a buffer, but there could be lots of other reasons too. | |
| |
Re: >>centimeters = (inches_per_foot * 2.5400); To convert feet to centimeters feet * 30.48 | |
Re: >>6 ^ 1 = 6X6? = 36 (IS THAT CORRECT??) No, that is not corrtect. 6 ^ 2 is 6 x 6. 6 ^ 1 = 6 you can use a calculator to verify the math | |
Re: Ohh did you catch the picture of Richard Simmons at the bottom :) :) He might seem a little wierd but got to give the guy a lot of credit for losing all that blubber. His before and after pictures are [URL="http://www.richardsimmons.com/j/"]here[/URL]. | |
Re: Unlike *nix you can install the source code anywhere you like. I downloaded mysql++-3.0.2.tar.gz and used WinZip to decompress it. In the uncompressed directory you will see volders for VC2003 and VC2005. Just fire up your compiler and select File --> Open --> Project Solution. Navigate to whereever you installed … | |
Re: line 36 of your program: Please read [URL="http://www.daniweb.com/forums/thread90228.html"]this thread [/URL]how to flush the input stream because fflush() is only for output streams. | |
Re: What are you using for the gui program? OpenGL, DirectX, Direct Draw, QT, or something else? This is very very complex programming, so I hope you have a sound foundation in C and/or C++ programming because you will need it. | |
| |
Re: line 4: put all includes at the top of the file before anything else. It might compile the way you have it but its not the standard practice to put includes inside functions like that. As for your actual problem -- don't know. | |
Re: [QUOTE=zandiago;534739]AdditionallyBy the way, I'm using Vista (IE7).[/QUOTE] So do I and I have never seen (or at least noticed) that problem. | |
Re: do you know how to create a structure ? Not much to them [code] struct <struct name> { string name; int score; } [/code] Now just create an array of those things just like you did with the int array on line 37. | |
Re: One very common problem I had with porting from 6.0 was the use of loop counters, for example: [code] for(int i = 0; i < something; i++) // do something if( i == 0 ) // ok on VC++ 6.0 but not in C++ standards or VC++ 2005/8/9 [/code] MFC … | |
Re: >>for (y = 0, x = 0; y <= i; y++) should be < operator, not <= because array values range from 0 to, but not including, i Also, initialize arrays with 0 when declared to insure they do not contain random data [icode]arr[50] = {0};[/icode] In that same function … | |
Re: By "product manager" do you mean you work for a company that makes widgets with integrated computer and software? Or do you mean you work for a software development house to write computer programs exclusively? I suspect if you want to work as a product manager for a software house … | |
Re: Looks like the only thing you do not have is the default constructor. That is a constructor with no parameters. | |
Re: >>i have Visual Studio 2008 Which edition? the free Express edition can only do plain win32 api programs and console program. The program you are describing is a GUI with menus. Not all that difficult to achieve for someone familiar with win32 api programming. If you are not, then do … | |
Re: >>does anyone know what to do? Yes, don't you ? Use the [URL="http://www.cplusplus.com/reference/clibrary/cmath/cos.html"]cos() [/URL]function in math.h to calculate the cosignes of the numbers read from the data file. You first have to create the input file(s) probably using Notepad.exe or some other standard text editor from the operating system you … | |
Re: writing to file: why are you using C FILE and associated functions instead of c++ fstream? If you are going to write a c++ program then don't resort to C functions. It'll work but not very good practice or coding style. You need to pay attention to the warnings that … | |
Re: >>cout << "Loan " << x << " For $" add 1 to x so you get 1, 2, ... [icode]cout << "Loan " << x+1 << " For $"[/icode] >>cout << "has a payment of $" << (double)loanAmount[x]/(double)numMonths[x] << " per month." << endl; To get the sum of … | |
Re: >>The problem is it is displaying random numbers stored in the computer The problem is in the code you did NOT post -- show us the code that contains this line: [icode]DisplayEntry(data);[/icode] Most likely it is passing an instance of a structure that contains uninitialized data. When you declare the … | |
Re: If you mean [URL="http://www.sosmath.com/matrix/matrix0/matrix0.html"]matrix algegra[/URL] then the two arrays have to be the same size. But lets say you have two arrays [code] int A[] = {1,2,3,4,5}; int B[] = {2,3,4,5,6}; [/code] then array C[0] = A[0] + B[0], and C[1] = A[1] + B[1], etc. | |
Re: Threads are not natively supported by the c++ language but there are several api functions and libraries that you can use. One of them is win32 api function [URL="http://msdn2.microsoft.com/en-us/library/ms682453.aspx"]CreateThread()[/URL] Also see [URL="http://www.daniweb.com/forums/showthread.php?t=113820&highlight=CreateThread"]this thread[/URL] [edit]^^^ Tracey's example is excellent too.[/edit] | |
![]() | Re: date.cpp: >>Date:Date That should have two :, not one Date::Date |
Re: First you will need an int array that contains the cumulative number of days in each month. For example: [icode]int days[] = {0, 31, 59, ... };[/icode] Next chop up the string into its individual int elements. Then determine if year is a leap year, if so then add one … | |
Re: already answered that in [URL="http://www.daniweb.com/forums/thread119624.html"]your other thread[/URL]. | |
Re: line 8: don't you see something a little strange about that line? hint: () and ; | |
Re: Arnold was pregnant once -- I know because I saw his movie. [URL="http://www.imdb.com/title/tt0110216/"]Here's[/URL] proof. :) And [URL="http://ateros.com/pregnantmen/"]here's [/URL]more about pregnant men. | |
Re: >>wat should i put in here also?) identical to main() [code]int abc(int argc, char* argv[]); int main(int argc, char *argv[]) { abc(argc, argv); } [/code] | |
Re: A pointer *p is not necessarily a pointer to an array. It could be a pointer to some object [code] void foo(int* p) { *p = 0; } int main() { int x; foo(&x); } [/code] or a pointer to an array of ints [code] void foo(int* p) { *p … | |
Today I find that when I change a post code tags from [noparse] [code] blabla [/code] to this [code=cplusplus] blabla [/code] It doesn't work and acts as if something were misspelled or code tags were not present. But when I erase the [code] and retype the whole thing it works … | |
Re: lines 10-13: not needed. If you want a vector to start with a specific size then just call its resize() method line 42: [b]str[/b] is an empty string, so attempting to access anything beyone str[0] is an error. | |
Re: Don't know what caused that error. My suggestion would be to uninstall that compiler (see Control Panel) then reinstall from Microsoft Website, unless you previously saved the download file on your computer. | |
Re: >>My confusion is in myFunc1. What is happening? If you pass by value, exactly what value >> does Date dt contain (a pointer?)? Is Date d a local copy of Date dt? Yes. structures (classes) can be passed by value just like POD (plain-old-data) types. The ocmpiler makes a copy … | |
Re: >>So I know how to delete a descriptor from an array, define [b]descriptor[/b] | |
Re: lines 10-15 are wrong. Here is how to declare that array of strings [code] char *sentences[] = { "String1", "String2", // etc etc }; [/code] and delete lines 19 - 32 because they are all wrong. | |
Re: line 77: you can't call a constructor after instantiating the class objest (line 56). After that you must call the set functions. [code] students[i].setName(FirstName, LastName); students[i].setID(id); [/code] Make the score and point values part of the class so that you can easily match them up with the student. | |
Re: convert both dates to integer then all you have to compare is one simple integer. You can use the mktime() function in time.h to help you out. For example, 1 Jan 2008 is converted like this: [code] int main() { struct tm tm; time_t t1; memset(&tm,0,sizeof(struct tm)); tm.tm_mday = 1; … | |
Re: [QUOTE=Ezzaral;586453]Trying to Find the imp in the system that has been Needlessly Capitalizing Words and stealing Punctuation Whats Up With You[/QUOTE] The [b]imp[/b] in the system was a filter that converted all uppercase posts to lower case with the first letter capital. After some discussion I think Dani has disabled … | |
Re: >>if you could write the code you would have my undying gratitude I will after you deposite $10,000.00 USD in my paypal account. DaniWeb is not a sofware whorehouse. We help, you write. | |
Re: lines 8 and 13 must have identical parameter types. Normall do not use cin in the set functions. Put all cin statements in the main() or whereever but not in the set functions. In the set functions just set the class variable to the parameter [code] void setName(string name) { … | |
Re: since the array is global it isn't necessary to pass it as a parameter. line 16: just make that a function call [icode]reading_data_into_array();[/icode] line 21: make that a void function because it isn't necessary to return anything and delete the parameter because the array is global.. line 24: you need … | |
Re: I don't care much for wine, but I'll drink it if I have to :) I absolutely hate whiskeys and burbones. My favorite is Black Russians, vidka and gin. But, alas, I can't drink any of that any more ***sigh*** |
The End.