Beginners - September 2012 (Page 7)

by weliot
How do i do a function?
 
I'm taking a basic class of programing but we're kind of slow and i want to know hot to do a function and how does it work. If the answer can be with an example...
[4 replies] Last: thanks fransje it was very helpful (by weliot)
An easy problem
 
Can someone explain me what does "(integer + integer) >> 1" mean ...
[6 replies] Last: Note that shifting to the left is equivalent to multiplying by powers ... (by closed account zb0S216C)
Coding help with if statements and comparisons
 
//This program solves the qudratic equation #include <iostream> #include<cmath> #include<iomanip> using namespace std; int main() { //Declaring Varibl...
[3 replies] Last: If you want to check if x4 is less than 0 I don't see why you don't ju... (by Peter87)
Extracting info from a variable
 
Hi! Suppose we have this statement. int year; cout << " Enter the year " << endl; cin >> year; Suppose the user entered 1988 as t...
[1 reply] : modulus year % 100; //yields a number between 0-99 1988%100 = 88 1... (by clanmjc)
Variables losing values
 
Hello everybody, i have got a little problem. It's not the first time that happens and usually i've achieved to pass it, but without understanding its origin. ...
[2 replies] Last: Here's the code for the constructor First thing I notice is you are ... (by clanmjc)
Error
 
When I run this program, I get the following errors Error 1 error C2146: syntax error : missing ';' before identifier 'total'(line 25) 3 IntelliSense: expect...
[2 replies] Last: I do not see here a semicolon tax = .06 * (item1 + item2 + item3 + it... (by vlad from moscow)
by skarla
snake source.
 
Guys i have a snake source but i have a small problem. Whoever is very good with c++ can send his skype and add him.
[4 replies] Last: How would I go about growing the snake without 'bloating' my code? (by DesiredNote)
Enum usage.
 
Hello, My algorithm has a few "modes", currently defined by an integer 'id'. A lot of my code features "breaker functions", which accept generic input and th...
[2 replies] Last: Thanks, working so far! Additional question: is there any kind of iss... (by Gaminic)
by Clark
Derived Template Class Copy Constructor Problem
 
I'm having trouble with my copy constructor is a new derived class I've created. Relevant code is as follows (I can provide other code from my project as well, ...
[7 replies] Last: Actually, that did fix it! I forgot to rebuild the solution after that... (by Clark)
I finally solved the guessing machine!
 
So i finally solved the bracketing search beginner excercise! And, to learn c++ better, i usually come here to ask for more efficient ways of writing the progra...
[7 replies] Last: Thank you tnt, i did not think about this. Html, that does look more c... (by Terje Gundersen)
by MattV
C++ Intro
 
Hi, everyone. So my professor gave the class an assignment and what it had to do is basically have the compiler say: Enter two numbers: x y x "plus" y "equa...
[2 replies] Last: If you are forced to use a void add function than u could do: #incl... (by gtkano)
Vector problems
 
Hi there. I'm currently trying to code up my own Vector container class, starting with a 2D vector, then adding a 3D vector after. However, after writing up ...
[7 replies] Last: Vector2D<int> and Vector2D<float> are two different types. You defined... (by vlad from moscow)
#define ENUM_OR_STRING( x ) #x
 
Hi, In the following code, #undef ENUM_OR_STRING #define ENUM_OR_STRING( x ) #x What does the #x mean? is that a way of returning values f...
[5 replies] Last: Thanks indeed!!! Helped a lot!! (by DeepBlack)
Troubleshooting error LNK2019: unresolved external symbol
 
Hello folks, I'm trying to build a simple program that accepts and stores contact information (first name, last name, phone number) but ran in to a linking e...
[4 replies] Last: Thanks all for the response. I think I solved the problem with cont... (by EtDecius)
Why i can't compile this code??
 
Ok..this is too long so i will devide the code.. can anyone help me to made it right? #include <iostream> #include <conio.h> #include <vector> #include <s...
[3 replies] Last: Ok. This is soooo long(as you said), and it will scare most people fro... (by Aceix)
create a timer without using loops
 
no while or for loops allowed. It has to be a function that is repeatedly called for different values given in seconds. I have seen many codes for timers on the...
[2 replies] Last: POSIX: http://www.freebsd.org/cgi/man.cgi?query=timer_create+&apropos=... (by JLBorges)
Picking a random text file from a folder
 
So I made a random weapon generator and it creates a text file containing the information on the weapon it made What i now want to do is write another progra...
[3 replies] Last: > searching for a long while i found these things i may need but im cl... (by JLBorges)
by febeme
Program help
 
What's up guys. I need help, idk what I'm doing wrong but I'm really frustrated, I'm new at this but I think I may be on the right track, but I still want to be...
[5 replies] Last: Woot!!! first +1 (by Aramil of Elixia)
Assistance in fixing an almost-complete program?
 
So this program is supposed to take the day, month and year and be able to show you the weekday of that particular date. Problem is I always get the output 84 f...
[5 replies] Last: bottom line is that functions won't 'activate' unless another function... (by TheJJJunk)
by Dunii
Individual Digit Management in intetegers
 
I was writing up a program for calling up data from a file when I realized the way I "coded" it didn't have a way to call it back effectively. That probably mak...
[2 replies] Last: For a long string of numbers, for (int i = 0; i < ARRAY_SIZE; i++) {... (by TheJJJunk)
September 2012 Pages: 1... 56789... 62
  Archived months: [aug2012] [oct2012]

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