Beginners - January 2013 (Page 37)

Is there a shorter way
 
Is there a better/shorter way to write this program? This is the problem: Write a program which calculates a student’s end of semester grade based on the ...
[2 replies] Last: It's only a little shorter, but if you wanted to add 100 more assignme... (by Stewbond)
tense about looping
 
how to loop your percent
[1 reply] : for (double percent = 0; percent <1.0; percent += 0.01) //do someth... (by Stewbond)
C++
 
How to create a table form in C++?
[1 reply] : Here's a QTable class from Qt: http://doc.qt.digia.com/3.3/qtable.html (by Stewbond)
C++ Video: Tricky Reverse Iterator
 
This video talks about the relationship between iterator and reverse iterator and how to convert between them. http://www.youtube.com/watch?v=V89gtNl4pZM
[no replies]
can't load string array with getline
 
I'm trying to load users from a .txt file. I do this in the first lines of main(); I did my self a check to see if the files are being loaded during the loop...
[3 replies] Last: Chervil is right, if you open a file in main, it's not open for other... (by cire)
Missing function header - help please
 
I'm just learning how to use c++ and am stuck with why this error keeps coming up saying im missing a function header '{' (old-style formal list?). please help...
[2 replies] Last: Thanks. I've been copying my indentation from the tutorials... any tip... (by Katieeee)
Rand() issue, game concept
 
Thanks for all the helpful answers you guys provided me with before I even registered. I have been lurking extensively, but am still quite the noob to programmi...
[3 replies] Last: @ Peter87 Problem solved! Thanks! (by acosmist)
about bitwise
 
who can explain about these: (6*6+6)^(2-9%4) = 43 ? who can explain to me what is exclusive bitwise OR ^ (6*6+6) = 42 (2-9%4) = 1 why the answer ...
[5 replies] Last: so, for dealing with ^ and | we ust convert give values to base 2 ... (by muhammad92)
Problem With SFML
 
Hey guys I've decided to start programming with graphics and I've heard SFML is a pretty good library for it. However, I'm having a problem. The code that I ...
[3 replies] Last: I Would Change to SFML 2.0 (by Pickle Gunner)
by Pebble
Compound Types
 
I've ran the following program: #include <iostream> int main() { int aval = 6; int valu = 3; int &six = aval; int &three = valu; --aval; ...
[3 replies] Last: Finally got it. If it was described in the book (C++ Primer) the same... (by Pebble)
typedef naming convention
 
"Under C convention (such as in the C standard library), types declared with typedef end with '_t' (e.g., size_t, time_t)." How rigidly should this be follo...
[1 reply] : POSIX reserves names ending with _t so if you care about POSIX you sho... (by Peter87)
Error checking Int for a non-Int
 
Hi there... I wrote a reverse "Guess The Number" game while studying from a textbook, and I put in some error checking, but I couldn't figure out how to check a...
[3 replies] Last: Hmm... I don't really understand any of that. Guess it's too advanced ... (by kythlyn)
if structure
 
how to write an if structure that prints the word complete to the screen if the variable named percent_complete is equal to 100?
[6 replies] Last: Who's fighting? (by closed account 3qX21hU5)
Problem with functions
 
I created different functions to make the programming easier. Here they are: bool fexists(string filename) { ifstream ifile(filename.c_str()); i...
[5 replies] Last: The code int GetNewFileNumber() { for(int i=0;i<MAX_USERS;i++) ... (by vlad from moscow)
by adrem7
Illegal Instruction 4 Mac
 
I am running a piece of code I have written and it looks as follows: #include <stdio.h> #include <string.h> #include <math.h> #include <iostream> #incl...
[17 replies] Last: You're welcome. (by closed account z05DSL3A)
no match for call to
 
hello! i have a class with default constructor and another constructor : class Row { public: int flows_len; s...
[5 replies] Last: You could use vectors and save yourself the trouble. That class doesn'... (by Cubbi)
strcmp not working (console)
 
Hey guys, so, for my homework, I got to do this project which works like a database with people. I just started and I already got stuck. In the startup menu,...
[1 reply] : That's because strcmp is expecting const char * as the first param... (by AbstractionAnon)
by jaded7
container iteration
 
Suppose you have the following code. The size, and the values used are arbitrary, and only are just exemplary. Example 1 std::vector<int> myVector(5...
[4 replies] Last: The first loop will fail if the size of the vector exceeds INT_MAX, th... (by Cubbi)
Components and entities
 
Hey, i'm trying to make a component based entity system and have a little problem. class ControllerComponent : public IComponent { public: virtual ...
[1 reply] : > what I want to do is to let my component to know its entity, Sorry, ... (by ne555)
Primitive type sizes
 
I keep hearing that the C primitive types (with the exception of char) are ill-defined and the sizes are not guaranteed. Obviously if I am trying to pack a tra...
[3 replies] Last: Ah great! I've seen people use int32_t but I never knew where it wa... (by Stewbond)
January 2013 Pages: 1... 3536373839... 52
  Archived months: [dec2012] [feb2013]

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