|
Super Dude posted:using erase(j) gives this error:
|
# ¿ Mar 9, 2008 06:36 |
|
|
# ¿ May 3, 2024 16:57 |
|
BraggPxnk posted:drat, I was hoping there would be something a little easier than learning an API but oh well.
|
# ¿ Mar 25, 2008 00:10 |
|
ShoulderDaemon posted:I think the problem you're having is likely a problem very typical of new programming students: You think you understand what you want the computer to do, but you haven't yet set it down step by step, so you don't know how to program it. You're focusing on the "little" problems of your application instead of the "big picture", which makes everything more difficult because you aren't yet sure how the parts all need to fit together. To say it another way, there are two steps involved in programming: specification (precisely stating what you want the program to do), and implementation (mapping that into code). New programmers often make the mistake of underestimating the former.
|
# ¿ Mar 31, 2008 10:16 |
|
ShoulderDaemon posted:
|
# ¿ Mar 31, 2008 20:30 |
|
Viper2026 posted:I changed the row/col size variables to type of size_t and now it lets me create the array given the values read in from my file. However, when I try to call my function: Go look at Paniolo's post again, particular the first code block.
|
# ¿ May 6, 2008 09:08 |
|
Soldat posted:Well, we've learned scheme and writing interpreters for it all semester and spent the last week or so in my intro class getting acquainted with c++. I suppose I didn't realize the level of coding that people expect questions to be asked about in this thread. I suppose I can take it to the yahoo! message boards or something. This is about my 8th program or so, if you include the several hello world! type ones that we did. I'm attempting the extra credit parts of a project where we haven't been introduced to classes yet, so thanks anyways for the code, but I can't use that. As I said, I'm a newbie. Thanks to those that were helpful.
|
# ¿ May 10, 2008 19:34 |
|
Your problem is an error in the logic of your setXroom() method. What you seem to want is for a.setnorthroom(&b) to set a.northroom = b and set b.southroom = a, but that's not what your code is doing at all. What setnorthroom() actually does when you call it in main() is that it sets adv.northroom AND adv.southroom to adv2, but does not change adv2.
|
# ¿ Jun 4, 2008 04:03 |
|
chutwig posted:Most of my confusion originates in what I perceive to be counterintuitive syntax by C. When you write something like char *blah, if you're reading it left to right, you initially think it's a variable of type char, and then have to reset mentally and re-read it as a pointer pointing to something of type char. I feel that syntax such as "&char blah", which could be read "address-of-char", would have been a more intuitive way to declare a pointer. And yes, the overloading of the * operator is fairly obnoxious, but then again I could say the same about the . operator in Java.
|
# ¿ Jun 14, 2008 02:06 |
|
Zombywuf posted:Wrong wrong wrong, bad and wrong. auto_ptr defines ownership of heap objects and will defend you from the problems of memory leaks caused by exceptions they complain about elsewhere. quote:I think most of the rebuttal to to those style guidelines is "Don't hire Java programmers to do C++."
|
# ¿ Jun 30, 2008 11:38 |
|
sarehu posted:That's not true. You can write a program that takes the state of any given computer and tells whether a program on it will halt.
|
# ¿ Jul 13, 2008 21:47 |
|
Avenging Dentist posted:And it's more important to get people in the habit of considering the concept of RAII when writing C++.
|
# ¿ Jul 24, 2008 01:37 |
|
|
# ¿ May 3, 2024 16:57 |
|
Anunnaki posted:I'm working on an assignment for my C++ class (instructions here). I've got everything working so far, except the output for the maximum profit, its ticket cost and number of passengers. (I'm not going to give you code because this is a class assignment and I'm not going to do ALL of your homework for you.)
|
# ¿ Oct 11, 2008 10:08 |