Beginners - September 2010 (Page 28)

#define versus const dataType dataName [= initial value];
 
I've been teaching myself C (for about a year) and taking a class on C++ (for about 3 weeks). I have been using the #define preprocessor directive to define nam...
[6 replies] Last: The preprocessor only does text substitutions. This could potentially... (by moorecm)
no match for operator<< in std::cout
 
I have a really small snippet of code here: void attack() { system("CLS"); cout<<Hero.getDmg<<" attacks!\n\n"; Sleep(100); cout<<mon.ge...
[2 replies] Last: Omg I'm making so silly mistakes lately... Thanks! (by xander333)
Representing a power
 
Can someone tell me how I'm meant to represent a power in a function? Obviously I can't use ^ . For example, in an interest calculation such as: Interest = B...
[7 replies] Last: Are beginners often this strange or is it just me? Happens all th... (by firedraco)
Union of sets
 
I have to make a union of two sets, and I can't figure it out for the life of me. The main problem is that I can't visualize how the data structure is set up. I...
[4 replies] Last: I'm clueless as to what your first paragraph means. STL refers to t... (by AbstractionAnon)
Alas, I cannot get these types to agree...
 
I believe that the problem here is making the types agree, however, I am not sure how to do this. I have tried creating this little problem four different ways,...
[2 replies] Last: I think I figured it out. You are awesomely fast, though. I was not in... (by Randolan)
College Residency
 
I am trying to write a portion of my program that will ask a student to input whether they are a Resident or Non-Resident. In the class definition, I have cha...
[1 reply] : If the residency can only accept N or R, that should be in the constru... (by ne555)
by dlugo
Exporting info from int main(argc, char*argv[])
 
So I use the following function: int main(argc, char*argv ).... along with an ifstream to pull data from a txt file and stored it into an a multidimensional arr...
[2 replies] Last: OK... well I understand the example: int func2(int p , int width) {... (by dlugo)
Reading data from file to one-dimensional array
 
I have not programmed for many many months so I am really rusty and I do apologize in advance if I am slow. My question is how do I read data into a one dimensi...
[6 replies] Last: I think the problem is that you declare your array as local to your fu... (by Galik)
by Gyula
Program closes
 
Hi, I'd like to ask for your help. I am a begginer in C++ and I just wrote a calculator, but as soon as I choose an option, the console immediately closes. ...
[9 replies] Last: ok.. y now that bad habits are not good..to be honest y have no clue w... (by Mihay07)
how to make a ticking clock
 
i am just a beginner in c++ amd dont know a lot here is a simple code #include <iostream> #include <ctime> using namespace std; int main () { ...
[no replies]
by mozly
0xC0000005 error
 
So I was working on code and then I experienced a power outage. When I went to build my code I got this message: Unhandled exception at 0x68129d00 in aside 1...
[5 replies] Last: Yes. (by helios)
Cleaning Up Code - Question
 
Back when I first started my project I didn't understand the use of functions very well so I put the bulk of my game content that is the map and text portion of...
[9 replies] Last: Lol this wasn't exactly what my subject was about but feel free to hav... (by Snaef98)
programming exercises
 
hello, does any one know where i can find some good c++ programming exercises. I'm looking for some fairly difficult exercises (but not impossibly difficult?). ...
[5 replies] Last: Look at this: #include <iostream> int main() { std::cout << ... (by Bazzy)
data structure
 
ok, this might be a stupid doult, but heres it anyway union mix_t { long l; struct { short hi; short lo; } s; char c ; } mix; ...
[1 reply] : struct { short hi; short lo; } s; declares a single instan... (by jsmith)
What to put in which file?
 
I have decided to put a big project I was working on..into many files..(don't know, why I didn't at first)...But it keeps generating error messages. have I ha...
[1 reply] : http://cplusplus.com/forum/articles/10627/ <-- see section 4 (by Disch)
Checking the state of the input stream
 
How do I determine if there is anything (like a newline char) left on the input stream before reading more data from the stream? I have tried getchar() to ta...
[2 replies] Last: it's the peek that I can use, thanks. I will peek, and if I see what I... (by closed account Lv0f92yv)
by vlad61
Beep()
 
Hi I am using the Beep(hertz, millisecond duration) and I was wondering how I can decrease the time it takes for each beep to start, because the duration onl...
[11 replies] Last: Alternatively, you could use SFML, it has Audio-support too. (by Kyon)
What am i doing wrong?
 
Hi. First time posting here. I've run into a problem i can't solve by myself. I purchased a web course on programming basics using c++, and i'm on the chapter g...
[3 replies] Last: Alright, that clears it up. Thanks alot! (by mikaton89)
calculator
 
This is what I have so far...I'm not entirely sure how to use the do...while. I want the user to be able to enter up to 10 numbers after selecting an operation....
[6 replies] Last: A good structure of your program could look like this: void get_input(... (by hamsterman)
Advanced Color Text in console (1,2)
 
Is there any way to change the color in the console based on a boolean value? What i want to do is for quest status Make the string INACTIVE grey. Make t...
[21 replies] Last: I found an easier way to do it, i tried the array method and it didn't... (by Snaef98)
September 2010 Pages: 1... 2627282930... 32
  Archived months: [aug2010] [oct2010]

This is an archived page. To post a new message, go to the current page.