1,362 Posted Topics
Re: That error generally means that at some point your program wrote to a location outside the array's allocated memory. You see the error at the delete statement because the VS debugger gives these warnings at program exit. Check your array access carefully for any out of bounds writing. | |
Re: Each item in double quotes is actually two characters, the letter you see and a null terminator ( '\0' ). Just use single quotes around each character, like [icode]char Letters[26] = {'a', 'b', 'c',.....[/icode] Please don't start new threads when you're really adding to/correcting a previous one. You could have … | |
Re: [QUOTE=Rashakil Fol;739363]Get a better compiler. And post a real code example.[/QUOTE] His compiler's fine. You're really living up to your the interests you list in your profile tonight, aren't you? | |
Re: The point is, show the code you've written, and if you have some idea of what part's giving you problems, point that out. Then you'll find many people here will assist you in solving your problem. | |
Re: [QUOTE=mrboolf;738921]well you could use loops, something like <snip> [/QUOTE] Arrays and loops go together like peanut butter and jelly. Good things separately, great thing together. | |
Re: Read the intel, scan the whole field. I think playing full screen mode makes for more accurate shooting. 83% on level one, that's where I quit. | |
Re: Please read the sticky posts at the top of this forum. In short, we don't do your work for you. Write what you can, ask questions about problems you encounter. Here's two hints to get you going. You'll want to write a separate factorial function (many examples abound) and you'll … | |
Re: In a general sense, your cargo class could have a display method, and the aircraft's display method would simply call that for each cargo item in the list. | |
Re: It's information that is often available directly from the state official websites. In this case, I find it does not agree with my state's information. You must also watch out for sites like this that are total fabrications. I've seen one that generates totally different names and locations every time … | |
Re: Yes, you get clock functionality from library <ctime> (or maybe it's still <time.h> in VC++ 6) See [URL="http://www.cplusplus.com/reference/clibrary/ctime/"]here [/URL]for a quick reference. Check your MSDN help information in VC++ for what's actually supported in that compiler. Consider moving into the 21st century with newer versions. VC++ 2008 Express is a … | |
Re: Do a google search on "proper sitting" and you'll find a wealth of advice. Primarily chair height, seat angle, support for feet are the big concerns. If your doc is not concerned over "shooting pains" I'd get another doc! These could be symptoms of something serious. | |
Re: [code] #include <iostream> using namespace std; [/code] You got this correct? VC++ 2005 and 2008 should work just fine in Vista. | |
Re: [QUOTE=GrimJack;736391]What a load of crap! Someone comes along who does not try to lead by fear but by a vision of [B]what this country was founded on[/B] and the wingnuts go wild. Fear and Fascism lost the election, get over it and get behind our president.[/QUOTE] "Seven years before Barack … | |
Re: Yes, you've collected all the tools you'll need. Now put them together in some actual code. I kind of like your for loop - clever way you end it. Goes against my feeling that for loops should be controlled by the value of the counter, but it's more succinct than … | |
Re: It looks like you are supposed to read the entire text into one array, max size 256. Then, pull each word out, storing to a dynamically allocated array of strings (char ** ). You will have to find the length of each word, or at least the length of the … | |
Re: [QUOTE=dmanw100;734538]What kind of factorial is this? An input of 3 will result in an output of 6... it should be 3 * 1. If you enter 4 you will get something like 24. Factorials break numbers down like this: 12 factorial = 2 * 2 * 3. To implement a … | |
Re: Let the ridiculousness begin: [url]http://www.forbes.com/feeds/ap/2008/07/30/ap5272246.html[/url] ATLANTA -Georgia business groups are appealing a judge's decision to halt the construction of a power plant, warning that the ruling could stall other energy plants and hamper economic development throughout the state .... Fulton County Superior Court Judge Thelma Wyatt Cummings Moore's ruling relied … | |
Re: No one here is likely to "do it for you". If you have a question, we'll be glad to answer. Please read the sticky posts at the top of this forum, and place code tags around your program code, like: [noparse] [code] your code goes here [/code] [/noparse] | |
Re: For your problem, you need to use a file stream variable that's for reading. The ofstream is for writing. Once you've successfully opened the reading file stream, you can pass it to a function like any other parameter - BUT - it must be passed by reference. Your file stream … | |
Re: Well, you could start by reading the compiler error messages, they will at least point you to (or near) the places that need fixing. Read your textbook for the examples of how structures/classes should look - what's the difference compared to your problem? | |
Re: First, completely read and understand the assignment. The 2D array must be a parameter passed to the various functions. Declaring it in global space is not fulfilling the assignment and is, in general, not a good thing to do in programming classes, or real life programming. The array must be … | |
Re: Here's an interesting discussion on the topic: [url]http://www.codeproject.com/string/string_conversions.asp[/url] | |
Re: I don't see that the code you posted would display anything. In the reading loop, variable x counts how many records were read. Actually, it will have a count 1 too high based on the way you've set your loop control with the eof( ) method. Then, in the display … | |
Re: I think you need to state your problem a little more clearly for us. Are you trying to reduce the number of colors in a color image, or are you trying to convert a color image to greyscale? Or something else? | |
Re: The error is caused by your writing a value past the end of the array's allocation. Line 74 [icode]a[9][9] = c; [/icode] is the culprit. Remember, that for an array sized 10 x 9, the maximum index (the lower right corner) is [9][8]. What is the purpose of this line? … | |
Re: So he's chosen as his Chief of Staff someone who was very much in bed with Freddie and Fannie; on his economy team is the governor of a state that's in economic shambles. Yes, this will work out really well. Change. That's all we'll have left in our pockets. | |
Re: First you take a stab at it, post your code, tell us what's giving you a problem. But then you'd know that if you read the sticky posts at the top of this forum. | |
Re: It's been around several years, and was funny before. Now it's scary! | |
Re: Since your switch variable cho is a char, your case labels must be like [icode]case '1': [/icode] - the labels must be literal characters. | |
Re: You can use isdigit( ) to validate the input - you just have to do it one character at a time. And know when to stop. Your general algorithm seems sound. The last two steps are really one - as you do the conversion to binary, you will be filling … | |
Re: Without the [icode]using namespace std;[/icode] you will have to preface most everything from the libraries with std:: (and who wants lots of std's in this day and age?;) Without it, you might have to open a file like [code] std::fstream fin ("text.txt", std::ios::in ); [/code] The using statement makes everything … | |
Re: For your first problem, read a number from the file. Use that number as the limit on a loop that reads in values to be summed and averaged. Main loop comes around again, reading in the next count of values number, .... I'd put the reading statement for the count … | |
Re: In Visual C++ 2008 I don't get any errors, it works fine, using either way you've posted. Is there more to this than you're telling us? What is the exact error message you get? I would note, you are looking for problems in naming the struct type and the array … | |
Re: The return statement, with a value, simply returns that value to the caller from the current function. In the case of your main( ) function, this is "called" by the operating system, and main( ) returns a value to the OS upon completion. By convention, return value 0 indicates the … | |
Re: First, you state the problem in terms of 10 numbers for input, but your array and loops are sized for 11. If you just type in 10 numbers, the for loop is waiting for the 11th! Also, you pass an array to the get_integers( ) function, but inside it declare … | |
Re: That dress is fugly! Even on the model it's dreadful. | |
Re: [QUOTE=Ancient Dragon;731593][b]Location:[/b] My Town near St Louis Illinois [b]price in gallons:[/b] $2.05 (USD) $3.05 (AUS dollars) The price of gas is now 1/2 what it was a year ago.[/QUOTE] It's about 2/3 of a year ago, 1/2 of four months ago. Here's the [URL="http://www.eia.doe.gov/oil_gas/petroleum/data_publications/wrgp/mogas_home_page.html"]history chart[/URL]. Rapid City SD $1.97 per … | |
Re: John McCain came to the Sturgis Bike Rally. I don't think Obama could find Sturgis. Even with Google Maps. | |
Re: You do have function prototypes, and the prototype for move( ) agrees with your implementation? Seeing your full program would help. | |
Re: [QUOTE=Lerner;730332]My first thought is because int** is not the same as int[][], though the syntactic use of each is quite similar.[/QUOTE] You're quite right. The int** is a pointer that would be allocated an array of pointers, each of which point to an array of ints. int[][] is a contiguous … | |
Re: [QUOTE=TheBeast32;721078]Hello is spelled without the w. =) Also, trigonometry is the way to go. You can probably find a tutorial or something: [url]www.google.com/search?q=Trigonometry+Tutorial[/url][/QUOTE] My fingers get out of sync with my brain so often, every time I try to demo "Hello world" it comes out "Hellow orld" Or maybe it's … | |
Re: Well, that clears up a lot of questions I had about the process;) | |
Re: I recognize four of those. I'll add the London Symphony Orchestra. | |
Re: How are you reading in the input string? If you use [icode]cin >> str;[/icode] all you're going to get is one word of input. Use [icode]getline( cin, str );[/icode] to read in multiple word strings. Also, your loop control [icode]while(charPosition != (length + 1)) [/icode] is an OBO situation. | |
Listening to a "radio" broadcast on iTunes, one of the Live365 stations, and they've played an ad several times for "CIA Clandestine Services." I've seen print ads for them in magazines (military related), but find it a bit odd that they're advertising in this venue. [URL="https://www.cia.gov/careers/jobs/clandestine-service/view-jobs/index.html"]Here's where you can find … | |
Re: Visual C++ is C++, with the Visual Studio IDE. You should not encounter any significant differences between code written for other current implementations of C++. By Classic C++, I'm assuming you mean any of the other compilers such as gcc, MinGW, current Borland products, and not some old, out of … | |
Re: First, I'd like clarification on the assignment and the techniques you're supposed to be using. - Are you in fact supposed to use dynamically allocated array (using int * )? - If so, do you have to actually change the size of memory allocation, or just keep track of the … | |
Re: You're using a Borland compiler, which provides a library for graphics, which is not found on the destination computer. Check your compiler options for linking in the graphics features. |
The End.