Beginners - March 2010 (Page 22)

Rounding a whole number integer
 
I have been trying to solve a problem that requires me to round a whole number integer and add up the 3 integers. The problem being that if the integers most ri...
[2 replies] Last: You are freaken amazing! Thank you, I finally got it :) . (by sleepyfool)
easy qustion in c++
 
Hello guys, i would like to ask you about c++ language. i have an assignment and i want to do a movement for the hero? i have an assignment and i want to do a ...
[6 replies] Last: post some code please. (by hamsterman)
by hybzik
passing string type in multi-file compilation
 
After using c-strings / character arrays for a year now I'm being encouraged to use the string type instead. After getting some errors in a multi-file project...
[3 replies] Last: checked back for replies and even before I read any of them I noticed ... (by hybzik)
undefined symbol "cout", "cin", and "endl"
 
I have written a program to calculate the price of a phone call. There is a $1.99 connection fee. The first 3 minutes are automatically charged: $2.00. The p...
[3 replies] Last: lolz, you're welcome. I'm glad I could help. (by Dacster13)
Dynamic Array Memory Problems
 
i have to implement a sequence class that uses a dynamic array to store the items. i have implemented the functions following the book with a similar class. bu...
[3 replies] Last: hey, I'm still checking but I think I found something wrong with the r... (by Dacster13)
by kungfu
so new to this its not even funny :0(
 
hi am studying my but off for a long time now in java and have found it so hard i have a stock of self help books and i can only just creep along but i started ...
[9 replies] Last: umm, if you want to do that from scratch you should study the win32 AP... (by Dacster13)
Object Oriented Programming Questions
 
I need some clarification on some stuff. I'm using the "SAM's C++ in 21 days" book and am getting introduced to object oriented programming. In the book example...
[5 replies] Last: Look for a book that covers OO specifically if you really want to unde... (by tummychow)
Reading from a linked list
 
Here's my code: // Basic linked list #include <iostream> using namespace std; struct node { int num; node* ptr; }; void makeList(node* te...
[3 replies] Last: Okay, looking the code, I realized that nowhere in makeList do I use t... (by closed account jwC5fSEw)
by cmccmc
generate a text file?
 
how would you go about making a program generate a text file?
[4 replies] Last: There may be a flag to prevent it from engendering a file to fill an e... (by tummychow)
Logical error in finding the factorial by using the while loop
 
Hello, Here is the program: ------------------------ #include <iostream> using namespace std; int main () { int factorial; cout<<"Enter a p...
[1 reply] : Trace what your program does for a simple case, such as x = 3. f... (by jsmith)
mixed variables in a single array
 
I started having errors when I tried to work with the following code I instantly noticed I set the array as a string and I was trying to work with integers and...
[2 replies] Last: How would I go about doing that? (by Liger XT5)
How do i make a time limit on my console?
 
When i want the programme finsihed and i want the console to close, instead of the user hitting a key or inputting a character can i give it a time limit? like ...
[1 reply] : On windows you can use Sleep() http://msdn.microsoft.com/en-us/libra... (by Null)
by ven0m
Wierd cin.fail() behavior
 
Hey I am a software engineering student and just started my C++ course. I need help with understanding cin.fail() behavior. As far as i understood, doing som...
[no replies]
templated class member function declaration ???
 
OK, I have the following kind of self-explaining code (all irrelevant stuff is omitted) lsq_neq.h: #include<boost/numeric/mtl/mtl.hpp> template <typen...
[5 replies] Last: Thank you. I got it. (by Onanymous)
use the system date as filename
 
I want to output data to file that has a name of the current date on the computer. I used myInFile.open(date.c_str()) where date was set to the current system d...
[6 replies] Last: With a look at: http://www.cplusplus.com/reference/clibrary/ctime/strf... (by Liger XT5)
Put a Member Initialization List in a Constructor’s Definition
 
I have this constructor's definition: MyClass( int a, int b ): (this->a)(a), (this->b)(b) {} I thought that would be syntactically correct, but it's app...
[9 replies] Last: [quote=jsmith]Member initialization lists are the one and only one pla... (by moorecm)
by Jahmbo
Crypto exercises
 
Has anyone in here ever tried to make a codebreaker from scratch? I'm thinking about trying to build a codebreaker to crack a Vigenere (stright alphebetic su...
[3 replies] Last: That would be fine, even necessary with words like 'the' or 'is'. But ... (by Computergeek01)
how to get the "failure flag"
 
I've read that cin.clear() would clear any bad flags ( if set ) For e.g., int x; cin >> x; // a non-numeric value is entered ( i.e., 'r') cin....
[1 reply] : Using cin.bad() , .fail() , .good() and .eof() should work. You... (by Bazzy)
reinterpret_cast<>
 
int main () { int a = 100, *pt = &a; char ch = 'A'; cout << "as an integer pointer: " << *pt << endl; pt = reinterpret_cast<int*>(&ch); cout <...
[6 replies] Last: It absolutely does, but that does not mean the data it points to chang... (by jsmith)
instances of classes
 
Hi, I have a question about classes: this is hypothetical so the code may not be 100% correct, i'm just using it as reference. Lets say I have two classes: ...
[1 reply] : The first time I call class B it takes the first two numbers of the l... (by Disch)
March 2010 Pages: 1... 2021222324... 34
  Archived months: [feb2010] [apr2010]

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