Beginners - December 2013 (Page 4)

Help with magic square test program
 
Hello, i was trying to create a program that adds the diagonals and columns of a square, and if those are equal output the sum else output "-1" For the questio...
[7 replies] Last: Well here is my algorithm for calculating the sum of the 2nd last colu... (by Stormboy)
Calling class function without an instance of it
 
Hi how can I access a class function like this: For example I have a class Foo with a public function getMembers(). How can I access it like this: Foo.getMembe...
[4 replies] Last: OK I get it now. Thanks :). (by Stormboy)
by Zirkit
Update to previous, new issue.
 
So i rewrote my rock, paper, scissors, lizard, spock game. It now actually loads the console and runs good until the player enters a choice. When the player cho...
[1 reply] : I'm not going to read through all that- not to be rude. You should lea... (by jaded7)
Help with Visual Studio 2013
 
Hey I am very new to c++ programming but I've programmed in other languages such as Java, visual basic and html. I want to get started in c++ so I downloaded Mi...
[3 replies] Last: First open Visual Studio, then click 'New Project'. Then from template... (by Stormboy)
Could you improve my code before it's too late?
 
I thought before I continue any further with this I'd like some opinions on how to change this to become more readable/maintainable and the most efficient way p...
[6 replies] Last: Dput I cannot thank you enough for this response, it has made a lot of... (by closed account G30oGNh0)
Shouldn't binaries be cross-platform?
 
Sorry for the newbiness of this question. I am planning to go back to school and get a computer science degree, as I have come to realize that many of my intere...
[6 replies] Last: Right on, thanks for the info. I'm a big linux user so fatELF should d... (by narmada808)
Matrix multiplication
 
Hi everyone! I am student and I have started c++ program. I need some help in my assignment( Matrix multiplication ) This is an assignment: Multiplication of ...
[1 reply] : http://www.cplusplus.com/forum/articles/40071/#msg218019 (by ne555)
read individual digits from a number without % or /
 
I have a large number that cannot be stored in a long long (or anything smaller, obviously). I want to read the individual digits from this number. I am not qui...
[5 replies] Last: my final solution was to read it into a string and take it apart chara... (by heyyouyesyouiloveyou)
count vowel problems
 
whatever i do my programmer giving the same output and not counting my input where is my problem ? my goal is the get this Sample Input 2 Sa zanore ka Po ...
[4 replies] Last: He did use getline. The operator >> was for some integer that who know... (by giblit)
How do you randomly select a uniform value from a range of numbers?
 
Write your question here. How do you randomly select a uniform value from a range of numbers?
[2 replies] Last: srand(int) to seed the pseudo random generator, seeding with time(0) i... (by TheBeardedQuack)
how to shorten "line height" in win32 console application?
 
i want to shorten line height in DOS windows output. could anyone tell me how?
[no replies]
Cursor Thing
 
I am using visual studio 2013 express (just started c++) and every time I miss type something when I try to use my mouse or arrow keys back to the place it high...
[2 replies] Last: Thank you so much you made my life 1000 times easier (by phazion)
by nvrmnd
Qt Assitant wont open
 
it says it is missing a sql driver ? rhens@slitaz:~/Sources/qt/hello_world2$ assistant QSqlDatabase: QSQLITE driver not loaded QSqlDatabase: available dri...
[9 replies] Last: Download your dist's qt4 documentation package (on Debian it's: qt4-do... (by norm b)
where to declare variables
 
This is an more abstract question. I know the difference between global and local variables, but should i only declare variables as global when I know they need...
[2 replies] Last: thanks! (by heyyouyesyouiloveyou)
how to point a 2D array?
 
I tried to use a pointer int** to point to a 2 dimentional array, but failed. could anyone tell me how, cause i want to pass a pointer points to a 2D array. O...
[1 reply] : constexpr std::size_t NCOLS = 6 ; // const std::size_t NCOLS = 6 ; //... (by JLBorges)
by Zirkit
Help with rock, paper, scissors, lizard, spock
 
Hey all! I am a newb and need a little guidance. Quick note to let you know where I'm at: I have done some personal study, and tutorials off and on for a few ye...
[3 replies] Last: I see, the double = brought me down to 10 errors. I think I understand... (by Zirkit)
why is cin.get() discarding newline?
 
In the following code, why isn't pa->height equal to the null character, since after I enter the name, newline is left in the input queue? When I run it, I can ...
[1 reply] : That's because cin >> pa->height; will first discard any initial whi... (by long double main)
unique_ptr: is there problems with doing this
 
Is there any potential problems with using unique_ptr where a raw pointer is expected? void bar (int* i) { *i *= *i; } int main() { std::unique_ptr<...
[2 replies] Last: Thank you for a complete answer. (by closed account G30GNwbp)
How to get virtual functions to inherit?
 
#include <iostream> using namespace std; class A { public: int a; A (): a(0) {} virtual void f () {a = 111;} virtual ~A() ...
[2 replies] Last: -> void f() {A::f(); b = 3; } Yes. That is the generic method I w... (by prestokeys)
Mode of a set of data
 
An exercise in my textbook asks me to "Create a program that finds the mode of a set of positive integers." I am using user input to get the set of integers and...
[6 replies] Last: Thank you. This has helped a lot. (by heyyouyesyouiloveyou)
December 2013 Pages: 123456... 69
  Archived months: [nov2013] [jan2014]

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