Beginners - April 2011 (Page 23)

template class
 
Ok - so i'm attempting to create a template class, for creating arrays. Sort of a bit like what vector does, but specific to my needs. More than anything, it's ...
[2 replies] Last: ah, excellent - it was the ; in the wrong place!! typical :) thanks v... (by jazpearson)
help pleezz
 
my program writes wawawa, but i need to wwaaawawawwaaa, just write this randomly. #include <iostream> #include <windows.h> #include <stdlib.h> using name...
[3 replies] Last: Now i dont know where to include -sleep- element Before line 24. You ... (by coder777)
ANSI C++, ISO C++, library, API, structure
 
Please use simplistic explanations so that I could fully appreciate your help. Thanks. 1: I have been told that the standard for C++ is set up by ANSI.But I ...
[1 reply] : 1. ANSI = national http://en.wikipedia.org/wiki/American_National_Stan... (by coder777)
operator overloading
 
hi, I have written a program for operator over loading ad below and i am getting an error as 39 C:\Dev-Cpp\complex.cpp no match for 'operator<<' in 'std::...
[3 replies] Last: ya, but here i am trying to overload operator "+", and i am getting th... (by sagu072)
c++ searching in a file
 
I have such a program: #include <iostream> #include <conio.h> #include <stdio.h> #include <cstdlib> #include <string.h> #include <stdlib.h> #include <...
[1 reply] : this funktion is displaying one product and then program is bracking ... (by coder777)
Print a checkerboard (8-by-8 grid).
 
So I'm trying to work through a c++ book and I'm stuck on one of the exercises. Exercise 8-1: Print a checkerboard (8-by-8 grid). Each square should be 5-by-...
[2 replies] Last: As a start, two points: 1. You need an extra element in each array.... (by Alrededor)
by ascii
help me understand this example
 
when reading my C++ book (Beginning Visual C++ 2008 by Ivor Horton) i came across this example, and i just cant seem to understand it. it goes like this: #...
[3 replies] Last: For a one dimensional array the name of the array functions as a point... (by Alrededor)
Running Console Applications
 
Is it possible to run a console application on a computer that doesn't have a compiler on it? i.e I wrote a a program on my computer (on which I use Windows V...
[2 replies] Last: The program I am talking about is a .cpp file, I would guess an execut... (by bassoondude101)
multidimensional array within classes
 
I've been working on this all day. My actual code is more complicated, but for now I'm stumped with the bit of code below. Running this, I get a referencing e...
[4 replies] Last: The answer is that I must declare the two dimensional array as #incl... (by helasraizam)
Classes and objects with strings
 
hey guys, Im working on a small text based RPG, and im creating a class called obj to create all my swords and staffs and things, like such [code/] cla...
[1 reply] : use a string, not a char array: #include <string> // <- class obj... (by Disch)
Bitwise operator
 
if a = 3 b = 4 c = 6 what is (a|b&c) and how you find that out?
[2 replies] Last: Don't forget about operator precedence either. (a|b&c) is equivalent t... (by Browni3141)
Classes...?
 
I have a class for player health and battle. Then i have an integer for player health. Heres My Code: #include <time.h> #include <iostream> #include...
[6 replies] Last: mkay, I got the random number working. I moved User.Luck = rand & Fire... (by Widget360)
Input file trouble
 
#include <iostream> #include <fstream> #include <iomanip> #include <string> #include <cmath> using namespace std; struct webType { ...
[no replies]
emulators
 
#include <iostream> using namespace std; template <class T> long int funnyfunc(T val1, T val2, T val3); void testvalue(int value, short unsigned int co...
[no replies]
String
 
So I am making a program that lets you enter in a random string of 1's and 0's and it will output the exact opposite of that string. for example: 101001011 ...
[4 replies] Last: .... Don't read it into a char array, read it into a string. You don't... (by Athar)
by ascii
returning references
 
my question is involving returning a reference. from playing around, i have only been able to get it to function (no pun intended xD) when its returning the ad...
[4 replies] Last: in that case thank you good sir :) (by ascii)
templates
 
How to write a function template that simple takes two variables of the same data type and swap them?
[1 reply] : See the tutorial on templates. (by firedraco)
by wtf
need help remembering what a function call does.
 
I encounted the following line of code in one of my programs. I have no idea of what it does. I believe its part of the stl? fp(); The reason why I bel...
[5 replies] Last: No, I'm just trying to think of why did I do such a stupid and pointle... (by wtf)
passing objects to functions
 
So i wrote a collision detection function for a game im creating and it works as i want it to but now i'm trying to make it more general so it accepts any 2 obj...
[5 replies] Last: Have you considered refactoring your conditionals into a function and ... (by PanGalactic)
Don't understand error - Declaring class functions
 
I am getting an error in my code. I am using Visual Studio 2010, if that matters. The code is as follows: #include "include.h" using namespace std; templa...
[3 replies] Last: Yeah, but that still isn't all correct. (by guestgulkan)
April 2011 Pages: 1... 2122232425... 55
  Archived months: [mar2011] [may2011]

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