Beginners - February 2010 (Page 26)

noob c++ question
 
1) so in c++ everything runs in order? like the compiler reads from the first line to the last, from top to bottom and execute code in that orde? 2) int main()...
[19 replies] Last: Actually, on most of the code I've seen, main() was always at the bot... (by chrisname)
Guess my number for the computer
 
I'm trying to reverse the guess my number program so that the user feeds the console a number and the computer has to guess it #include <cstdlib> #include ...
[3 replies] Last: Also use code tags please and proper tabbing/newlines. (by DrChill)
by Zakuro
01235
 
01235
[18 replies] Last: cout << "Enter a point with two coordinates:"<<endl; cout << "x is " ... (by iamhttp)
A statement at the end of the last case in switch statement (1,2)
 
Hi there! I've written this switch statement: switch(10) { case 0: //... case 1: //... ;} If I don't put ';' at the end of this statement, th...
[26 replies] Last: [quote=gcampton]the last case whether that be default, or case 2738723... (by Quentin)
by vlad61
code question
 
what line of code would i use if i for example have specified what my program does with an "if...blah blah do this" and now i want "if...anything else *error m...
[7 replies] Last: I'm sorry I was obscure, I was in a rush. (by abilify)
by cpp123
Problem with inheritance in C++
 
Here's the code: //gradedactivity.h class gradedactivity { public: char letter; void func(); char getLetter() { return letter; ...
[5 replies] Last: __super keyword is Microsoft specific. (by guestgulkan)
reference or pass by value
 
I read this www.cplusplus.com/doc/tutorial/pointers.html my question is which to use for a function, pointer, reference, or pass by value. My understanding is...
[9 replies] Last: In your opinion is visual studio proffesional edition a better tool fo... (by abilify)
by Daeo
Passing multidimensional arrays by reference
 
#include <iostream> using namespace std; int *ReverseArray(int *orig, int b) { int swap; int c = -1; for(int a=-4; a < -2; a++) { swap = orig ; or...
[no replies]
creating a table
 
hello, i'm having a problem with printing an array i would like to print a 2d array in the format 000 000 000 and this is my code #include <iostream> ...
[6 replies] Last: Do you see what you did wrong though? the first time you were not com... (by gcampton)
by Daeo
Mundane Question
 
I've been doing some experimenting with multidimensional arrays, and my goal has been to create an array in (main), pass it to a function, have the function alt...
[6 replies] Last: all i can say is if your index is iterating up from -4 then the array[... (by abilify)
inheritance problem
 
Hello Guys im trying to build a class with inheritance. I read a few online tutorials about it but i dont get the point. I tried to draw a circle with the c...
[1 reply] : You aren't linking against Asteroid.cpp. The implementation of your... (by jsmith)
templates
 
are templates used primarily for overloaded functions and classes where you have multiple data types for the same function/class, or varying arguments.
[4 replies] Last: I gave you several reasons why templates are used. (by jsmith)
urgent
 
please if i want to enter like 27 and want to count how many numbers from 0 to 27 except the like number e.g. 11 , 22 , etc. can any one help me in write this
[7 replies] Last: @moorecm, I would have posted the same if not for: no limited till 1... (by gcampton)
making a critical strike chance
 
hi in my console rpg im makinh i want to have a critical strike chance. i made a stat called agility. every point in agility is .5% chance to critical strike. h...
[11 replies] Last: correct: http://www.cplusplus.com/reference/clibrary/cstdlib/srand/ ... (by gcampton)
by arnaud
read analytical expression in a text file
 
Hello everybody ! I have built a C++ code last year for my Master's Thesis. Now, I would like to make this code easier to use for an external user. The id...
[8 replies] Last: Ok, thanks a lot for your help ! (by arnaud)
linked list
 
I am trying to make linked list and i am wondering if it is possible to make multiple linked lists without having to create them one by one. I have a certain...
[no replies]
i thought i didn't need a return type?
 
ok so i was running this program: #include <iostream> using namespace std; int function1() { int x = 12; cout << x << endl; } int main() { int y ...
[9 replies] Last: @jinjin12: Functions not declared to return void must return a valu... (by jsmith)
Newbie needs explanation, int_max
 
ok so i ran this program for class regarding INT_MAX. when i did it, i found that the INT_MAX for my computer was 2137483647 but when i when added 1 to INT_MAX,...
[15 replies] Last: Although it won't be that way for long, within about 5 years is my gue... (by gcampton)
overloaded assignment operator
 
//Overloaded assignment operator for CMessage objects CMessage& operator=(const CMessage& aMess) { //Release memory of 1st operand delete pmessage; pm...
[8 replies] Last: Thanks, its clearer to me now. (by abilify)
setting boolean variable question
 
i am trying to convert if ((grade != 'A') && (grade != 'B') && (grade != 'C') && (grade != 'D')&& (grade != 'F') && (grade != 'X')) { cout << "\nInva...
[6 replies] Last: http://www.cplusplus.com/forum/general/19081/#msg98787 (by closed account z05DSL3A)
February 2010 Pages: 1... 2425262728... 32
  Archived months: [jan2010] [mar2010]

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