02-05-2012
The error has nothing to do with it being a class or not...
You are passing it as a reference(&), which implies a single object. You should be passing it as a pointer(*) which implies one or more objects in a row -- i.e. a pointer to an object, or a pointer to several objects. You don't need to take the address of the array itself -- the array itself already is an address, which the [] operator converts into a direct access..
---------- Post updated at 04:38 PM ---------- Previous update was at 04:15 PM ----------
Why have you declared all your members as pointers, by the way? You'll have to allocate them or make them point to something before you can use them -- being pointers, they are useless until you give them something to point to. If you just want them to hold one value per object, remove the * and just let them be floats.
Last edited by Corona688; 02-05-2012 at 06:36 PM..
10 More Discussions You Might Find Interesting
1. Programming
Hi,
I've tried to use classes in my program, but the compiler simply gives an error on the word class . Am I the only one with this problem ? I have no idea how to use classes in c in linux environment(suse). If you've got any idea what should I do I would be very thankful.
Thanks to ya all !... (4 Replies)
Discussion started by: atticus
4 Replies
2. UNIX for Dummies Questions & Answers
im just trying to have some fun and kill some time writing a c++ program that has a person type in a car make and model then gives them a year and a price. or something like that. i always have problems getting it goin but once the ball is rolling im usually pretty good. anyone wanna help me out? ... (1 Reply)
Discussion started by: rickym2626
1 Replies
3. Programming
I was wondering if I could put the section at the beginning rather than at the end before the definition of the class.
const REAL ModMisfit::DefMinDT = 0.01;
const REAL ModMisfit::DefSigma0 = 0.01;
const double ModMisfit::DefDAngSh = 2;
const REAL ModMisfit::DefKBeta = 5;... (2 Replies)
Discussion started by: kristinu
2 Replies
4. Programming
Hi, i have a question about C++. Is it possible to declare a class with a member ot the same class? For example, a linked list or i want to convert this C code to C++ class (Elemento)
typedef struct elemento
{
char name;
char value;
List<struct elemento> ltElementos;
... (7 Replies)
Discussion started by: pogdorica
7 Replies
5. Programming
I have a file Map.hh shown below. I want to put the two classes Phase and Map in two different files Phase.hh and Map.hh. I have forward declaration before the Map class. How can I tackle this situation?
//////////////////////////////////////////////////////////////////////////
#ifndef... (3 Replies)
Discussion started by: kristinu
3 Replies
6. Programming
Hi,
I believe the next code is wrong:
class Egg {
Egg e;
int i;
Egg(int ii=0) : i(ii) {}
};
because you would end up with an endless definition (memory allocation) of Egg objects, thus int i.
Ok, so God Eckel proposes for a singleton:
class Egg {
static Egg e;
int... (5 Replies)
Discussion started by: xavipoes
5 Replies
7. UNIX for Advanced & Expert Users
Hi all!
I am trying to register a device in an existing device class, but I am
having trouble getting the pointer to an existing class.
I can create a class in a module, get the pointer to it and then use
it to register the device with:
*cl = class_create(THIS_MODULE, className);... (0 Replies)
Discussion started by: hdaniel@ualg.pt
0 Replies
8. Programming
I have the two class definition as follows.
class A { public: int a; };
class B : virtual public A{ };
The size of class A is shown as 4, and size of class B is shown as 16. Why is this effect ?. (2 Replies)
Discussion started by: techmonk
2 Replies
9. Programming
Hello All,
I am a learner in C++. I was testing my inheritance knowledge with following piece of code.
#include <iostream>
using namespace std;
class base
{
public :
void display()
{
cout << "In base display()" << endl;
}
void display(int k)
{... (2 Replies)
Discussion started by: anand.shah
2 Replies
10. Programming
Can anyone tell me if this is correct when creating classes in Java?
public abstract class Animal
{
public class Point
{
public int x,y;
}
public class Animal
{
protected Point loc;
protected String name;
protected Random rng;
String... (3 Replies)
Discussion started by: totoro125
3 Replies
LEARN ABOUT DEBIAN
html::formhandler::widget::wrapper::bootstrap
HTML::FormHandler::Widget::Wrapper::Bootstrap(3pm) User Contributed Perl Documentation HTML::FormHandler::Widget::Wrapper::Bootstrap(3pm)
NAME
HTML::FormHandler::Widget::Wrapper::Bootstrap - Twitter Bootstrap 2.0 field wrapper
VERSION
version 0.40013
SYNOPSIS
Wrapper to implement Bootstrap 2.0 style form element rendering. This wrapper does some very specific Bootstrap things, like wrap the form
elements in divs with non-changeable classes. It is not as flexible as the 'Simple' wrapper, but means that you don't have to specify those
classes in your form code.
It wraps form elements with 'control-group' divs, and form 'actions' with 'form-actions' divs. It adds special additional wrappers for
checkboxes and radio buttons, with wrapped labels.
DESCRIPTION
Tags supported:
label_no_filter -- don't html filter the label
label_after -- useful for putting a colon, or other trailing formatting
before_element -- insert tag before input element
input_prepend -- for Bootstrap 'input-prepend' class
input_append -- for Bootstrap 'input-append' class
input_append_button -- 'input-append' with button instead of span
no_errors -- don't append error to field rendering
after_element -- insert tag after input element
AUTHOR
FormHandler Contributors - see HTML::FormHandler
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Gerda Shank.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.14.2 2012-06-25 HTML::FormHandler::Widget::Wrapper::Bootstrap(3pm)