Beginners - February 2012 (Page 37)

Matrices in xcode-Beginners coding
 
My homework is to create a computer program that calculates and outputs the inverse of the 2x2 matrix (-2 -5) (1 3)  I wrote this, but it didn't work. I p...
[8 replies] Last: Thank you so much. I finally got it. The table we learned would probab... (by Fraidy Levilev)
by jaff
Function returning multiple dynamic arrays
 
Hello everyone, A function in my program should return two arrays and a number. The problem is that the two arrays are dynamic - I cannot pre-define their si...
[3 replies] Last: Ah yes, makes sense now! I was trying it the other way around: I was u... (by jaff)
Cstrings and strcat?
 
Hello all. I'm trying to use the strcat function with cstrings, but it wants me to use char*'s. This would be fine, except I'm using MFC and have declared cstri...
[3 replies] Last: Well, I feel dumb now. Thank you guys! (by NerdTastic)
segmentation fault in linux
 
Hello, I wrote a program to evaluate some files. Compiled and run in windows-cmd it worked perfectly, but now I am trying to use it in Ubuntu 10.04 and am gett...
[3 replies] Last: Linux is case sensitive. Also make sure they have read and write permi... (by wolfgang)
How is it 2? (Modulus Question)
 
So I ran the following code in my compiler: int k = 24 / 9 % 5; cout << k << endl; The output is 2. But I don't understand how it can be 2. No matter what ord...
[2 replies] Last: Modulus gives you the remainder of an integer operation where divide g... (by wolfgang)
by Baso
Programmer and mathematics
 
As a programmer ( games programmer ) What should I know about mathematics? If you suggest books, that would be great. Thanks
[2 replies] Last: They fall under the Physics band, but I would added differentiation an... (by MrHutch)
creating unnecessary newline
 
print() { cout<<"\n "; cout<<"Item Description Qty Unit Price Amount\n"; cout<<" "<<pn <<" "<<qty<<" "<<up; return 0; } why is it af...
[3 replies] Last: i have solve it my self,, unknowingly,, i put a "\n" (refer to newline... (by yhangel)
if and for condition statements
 
Okay, so I was solving one of the Euler problems, and I came across a rather peculiar doubt... Till now, I had thought that: for (i=1; i<=max; i++) if (s...
[2 replies] Last: Ooooh, now I get it.. So in the for loop, when the condition evaluates... (by Caprico)
im a newb and need help
 
So i am trying to Write an application that asks a user to type A,B,C, or Q to quit. When the user types Q the program ends. When the user types A, B , or C, t...
[2 replies] Last: I would suggest only using 1 loop. The logic goes something like: g... (by cire)
by shangy
I need assistance with Voting Poll Program
 
Suppose a new member of the city council has to be chosen from three candidates and suppose there are 4 voting stations. We need a C++ program that will count ...
[no replies]
SFML problem
 
Hi all, I have some trouble to get SFML working. I am using the Code::Blocks IDE. Tried the following: 1. unzipped SFML-1.6 into c:\SFML-1.6 2. In Cod...
[2 replies] Last: Thanks for the reply. Meanwhile I've found a nice tutorial on youtube.... (by HomesickAlien)
by atjm88
what is ||?
 
Hi, may I know what is || inside this program? Is it means "or"? If yes, how to write for "and"? (mark<0 & mark>100) or (mark<0 && mark>100) ? or both are ...
[11 replies] Last: Hi, wolfgang, ur code direct give output as -1 as soon as I run it bec... (by atjm88)
is it possible to write this shortly?
 
#include <iostream> #include <algorithm> #include <vector> #include <fstream> using namespace std; int biggest(vector<int>); int index(vector<int>); cons...
[7 replies] Last: Great! thanks a lot. (by mishonacro)
by jalfor
Pointers To Objects
 
Just a quick, simple question...why doesn't this work. I can't work it out. #include <iostream> using namespace std; class stuff { public: ch...
[5 replies] Last: It works! Thanks a bunch, though I had to get rid of the dereference o... (by jalfor)
If, Else If and Else
 
int main() { int r; int Yes; int No; cout << "Are you alive? "; cin >> r; if (r = 'Yes') { cout << "Yes." << endl; } ...
[3 replies] Last: Thank you Moschops. Everything is working now. (by TruYadoo)
Problem with functions and triangle sides
 
I'm trying to make a function that assigns numbers to types of triangles when given 3 numbers. Ex: 3=equilateral, 2=isosceles, etc. But when I'm trying to call ...
[1 reply] : Your code doesn't compile because the function triangle_kind doesn't r... (by cire)
Is pre-defining lots of objects inefficient?
 
I understand that using global variables is a bad idea, because that variable is taking up memory space the entire time the program is running even though it's ...
[2 replies] Last: Using global variables is generally considered a bad idea because thos... (by cire)
In console: how to make part of console window not moveable?
 
Hello, I want to test my programming skills(and also learn few things), so I decided to create text-based Role-playing game in c++. Here's how I'd like it to ...
[7 replies] Last: I disagree. I don't see any reason he can't do both at once. (by Duthomhas)
MAC jGrasp Running Problem.. Please Help
 
I just installed jGrasp on my macbook pro running OS X v10.6.8 and tried to compile and run a simple code i was assigned in class. #include <iostream> usi...
[1 reply] : Turn on "Settings" / "Verbose Messages" and see if you get any additio... (by lbarowski)
What is an example of entry level coding? What would you work with on a job?
 
So I am sort of familiar with for, do-while loops, operators, variables, declaring variables, switch statements and a few other small things. There is an ope...
[no replies]
February 2012 Pages: 1... 3536373839... 64
  Archived months: [jan2012] [mar2012]

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