Beginners - July 2010 (Page 3)

rounding errors?
 
hi all, i recently replaced the following calculation, which is a sum of products: r1.sumNCp = O2.N*O2.Cp + N2.N*N2.Cp + H2O.N*H2O.Cp + CO.N*CO2.Cp + CO2.N*C...
[1 reply] : Look up "What every computer scientist should know about floating poin... (by jsmith)
Accesor and Mutator
 
Here is the example that is in question * Only member functions of a class are allowed to access the private data fields of objects of that class. ...
[1 reply] : That's the whole point of having private members. They're only accessi... (by filipe)
Prime Number program
 
Hi, I've a doubt about a program taken on a guide. It find all prime number from 1 to 100. #include <iostream> #include <cmath> using namespace std; int...
[4 replies] Last: Ok thanks you all, my apologies, i told 1 was a prime because in itali... (by Spark3n)
cout.setf() How to print in center
 
I am using this code for printing into the center. But output is left justified. please tell me what is the mistake and kindly correct this syntax. cout.set...
[1 reply] : There is no 'ios::center' justification. You have to do that yourself.... (by Duthomhas)
more efficient way of calculation hash index
 
I'm working on a program that will accept a string and then return the hash value similar to the formula in java.lang.String.hashCode(): str *(31^(n-1))+ st...
[1 reply] : You don't need recursion to calculate pow(): int result = 1; for(in... (by hamsterman)
by b52
Detecting prime numbers
 
My solution seems quite different from the one in the 'Solution Guide'. Will mine detect all primes or will it break? It appears to work but I don't know enou...
[10 replies] Last: Oh lol yeah ofcourse, sorry >.> my brain doesnt work when im in an off... (by Skillless)
division by directive
 
hy guys. I have defined in my code the following: #define SIGMA 6.25; #define XBOXSIZE 2*SIGMA; and later, I use double a = XBOXSIZE cout <<...
[8 replies] Last: define variable outside of function -> global define variable inside ... (by Skillless)
AOA
 
please 'll someone help me to solve this assignments?plzzzz:( tommorow is last date of submition....! Regardz Due Date:30/07/2010 Guidelines  ...
[8 replies] Last: n thanx for guiding Athar... :) (by student302)
Two Dimensional char Array - Input Problems
 
Hello! I am trying to build a 2D char array as a part of a bubble sort program I'm working. Something is really hokey with my code, but I'm not sure what; I've...
[6 replies] Last: I got it! I was just confused about how to work a two dimensional arra... (by LotusEater)
Random Numbers
 
I'm posting this in the beginners section because there's probably a stupidly obvious reason as to why it wouldn't work. My question to you guys today is thi...
[5 replies] Last: Just to add to what was said above. I believe most implementations of ... (by spaggy)
Is Darkgdk a high or low level programming language
 
I know that c++ is a low level programming language, which essentially means that it is closely aligned with machine code which makes it run faster. But does...
[2 replies] Last: thanks mate (by Blessman11)
MyClass mc(); What is mc?
 
I known create object in stack with constructor like this: MyClass mc; // default constructor MyClass mc(1) // some custom constructor when i write like th...
[1 reply] : MyClass mc(); is a declaration for a function named mc that returns an... (by Athar)
by michy
connecting to server
 
hello, a newbie is back for another question... Currently i want to learn about using c++ connect to a server. normally, we only using this program connect to...
[1 reply] : Look up the winsock2 library. (by export)
Copy Constr vs = overloading
 
Copy constructor allows creation of new object from an existing one. Hence in the following cases copy contr wud be called: 1)Obj o1(o); 2)Obj o2 = o; (o ...
[7 replies] Last: @moorecm :That was the missing links that was causing me all the confu... (by phoenix111)
by Venom
Making a Win32
 
Hey I'm making a trivia game following the Win32 code from here: http://msdn.microsoft.com/en-us/library/bb384843.aspx I took that code and added what I thin...
[9 replies] Last: Please see if the following topic can help: http://msdn.microsoft.com... (by bobito)
Suquentially "searching" two arrays.
 
asd
[3 replies] Last: [quote=xcrossmyheartx]How would I do this? std::string search;... (by Galik)
classes, one particular problem
 
program checks for distance between two points. one function checks for if the two points are the same and returns a 1. program runs, however it always displays...
[1 reply] : Turn this -> if(check = 1) into this -> if(check == 1) and it shou... (by m4ster r0shi)
Pick randomly from array
 
Hello, I was wondering if there is a way of randomly picking a number from the following array... BUT... only picking each number once.... const char a...
[6 replies] Last: @firedraco. Nice! How big is that magic bag of functions? I'll be look... (by closed account D80DSL3A)
Pointers
 
Hi, I need help with my program. It needs to use pointers and meet the following criteria...having the user input a 12 character word. Store this word in a cha...
[4 replies] Last: @ koutsos1 (OP) don't post the same problem multiple times: http://ww... (by Bazzy)
Trouble with Functions
 
Hey, I'm new to c++ and I was in the midst of creating a fighting game with functions. For some reason (probably stupid) I generate a compile error (too few ar...
[7 replies] Last: Hey thanks everybody for your help! Here's the finished code for my g... (by wagnerpj)
July 2010 Pages: 12345... 31
  Archived months: [jun2010] [aug2010]

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