Sponsored Content
Full Discussion: Problem defining a struct
Top Forums Programming Problem defining a struct Post 302562410 by kristinu on Thursday 6th of October 2011 08:18:48 PM
Old 10-06-2011
Problem defining a struct

I have the following code and getting the compilation errors

Code:
baseLib/DynBaseObj.h:80: error: expected constructor, destructor, or type conversion before ‘(' token
baseLib/DynBaseObj.h:89: error: expected constructor, destructor, or type conversion before ‘(' token
baseLib/DynBaseObj.h:101: error: expected constructor, destructor, or type conversion before ‘(' token

Code:
///////////////////////////////////////////////////////////////////////////
//
//  --Module---------------------------------------------------------------
//
//                           <<struct> DynBaseObj
//
//                 Creates object with a value and a pointer.
//
//  --Attributes-----------------------------------------------------------
//
//  Value
//    + Value: T
//
//  Prev
//    + Prev: DynBaseObj*
//
//  Next
//    + Next: DynBaseObj*
//
//  --Operations-----------------------------------------------------------
//
//  DynBaseObj
//    + DynBaseObj(val: T)
//    + DynBaseObj(val: T, next: DynBaseObj*)
//    + DynBaseObj(val: T, prev: DynBaseObj*, next: DynBaseObj*)
//
//  --History--------------------------------------------------------------
//
//    V01 - DEC 1999 - Luca D'Auria
//          Initial release.
//    V02 - SEP 2008 - Luca Elia
//          Version fixed for g++ 4.3.0.
//    V03 - MAY 2009 - Christopher Dimech
//          Adopted C++ coding standards based on the IBM Standard C++
//          Library Reference Guide and the Ellementel Telecommunication
//          Systems Laboratory C++ Style Guide.
//    V04 - NOV 2009 - Luca D'Auria
//          Code changes after visit to RISSC-Lab.
//    V05 - JUL 2011 - Christopher Dimech
//          Adopted UML 2.3 for documenting class structure.
//
///////////////////////////////////////////////////////////////////////////

#ifndef DynBaseObj_H
#define DynBaseObj_H

#include <iostream>

#include "gendef.h"
#include "Vector.h"

// ***********************************************************************
// TEMPLATE CLASS: BaseObject
// ***********************************************************************

template <class T>
struct DynBaseObj {

    T  Value;

    DynBaseObj*  Prev;

    DynBaseObj*  Next;

    DynBaseObj(T  val);

    DynBaseObj(
      T  val,
      DynBaseObj*  next);

    DynBaseObj(
      T  val,
      DynBaseObj*  prev,
      DynBaseObj*  next);

};

//////////////////////////////////////////////////////////////////////////

DynBaseObj(T  val) {

  Value = val;
  Prev = Next = NULL;

}

//////////////////////////////////////////////////////////////////////////

DynBaseObj(
  T  val,
  DynBaseObj*  next) {

  Value = val;
  Prev = NULL;
  Next = next;

}

//////////////////////////////////////////////////////////////////////////

DynBaseObj(
  T  val,
  DynBaseObj*  prev,
  DynBaseObj*  next) {

  Value = val;
  Prev = prev;
  Next = next;

}

//////////////////////////////////////////////////////////////////////////

#endif

 

10 More Discussions You Might Find Interesting

1. Programming

struct tm problem

I receive an integer as argument for a function. within function definition i want it to be of type struct tm. eg.. main() { int a; ...... } function(...,..,a,..) int a; { struct tm tm; if(!a) ^ time(&a); ^ ... (4 Replies)
Discussion started by: bankpro
4 Replies

2. Programming

Problem accessing struct member

I have a struct as follows... struct A { int a; ucontext_t X; //ucontext_t is another structure } How do I define a pointer to the above structure variable X of the type ucontext_t from within another function? eg. void foo() { struct A a; /////WHAT COMES IN... (1 Reply)
Discussion started by: jacques83
1 Replies

3. Shell Programming and Scripting

Sorting/Filed Defining/Output problem

need a little help with a few tid bits. I wrote a script that checks the resoluion of image files and writes them out to a file then sorts the resolutions by largets Width. Then take the sorted files information and toss all the 835 widths into a seperate file. Ignore the redundancies its a... (1 Reply)
Discussion started by: TiredOrangeCat
1 Replies

4. Solaris

Problem defining remote printers on solaris 10

Good morning, I have a server with solaris 10 that I want to intall remote printers. I started lpsched deamon without problems with command: svcadm enable application/print/server I want to install printers that are defined locally on print server, so: lpadmin -p <device> -s <print... (2 Replies)
Discussion started by: bonovox
2 Replies

5. UNIX for Advanced & Expert Users

problem with netfilter hook function struct skbuff *sock is null..

iam trying to built a firewall.so i have used netfilter for it. in function main_hook sock_buff is returning null and in my log file continuously "sock buff null" is printed plse help to solve this problem.. (using print_string iam printing strings on current terminal (terminal we ping)) ... (1 Reply)
Discussion started by: pavan6754
1 Replies

6. Shell Programming and Scripting

alias defining problem in .cshrc file

Hi folks, I'm trying to define the following command as alias in .cshrc file: ls -ltr | grep ^d | awk '{print $9}' | xargs du -hs I defined it as the following: alias nirdirs '`ls -ltr | grep "^d" | awk "{print \\$9}" | xargs du -hs`' I've got the following error when I've run the alias:... (7 Replies)
Discussion started by: nir_s
7 Replies

7. UNIX for Dummies Questions & Answers

How to access a struct within a struct?

Can someone tell me how to do this? Just a thought that entered my mind when learning about structs. First thought was: struct one { struct two; } struct two { three; } one->two->three would this be how you would access "three"? (1 Reply)
Discussion started by: unbelievable21
1 Replies

8. Programming

Compiling virtual network adapter driver problem (net_device struct)

Hi, I found on linuxgazette.net/93/bhaskaran.html page very useful sample of virtual driver (not connected to real hardware). I try to compile it with no effect. So: I got fresh Ubuntu 9.10 (kernel 2.6.31-14) My source is saved in networkAdapter.c file in /usr/src/myModules directory. I... (21 Replies)
Discussion started by: Chrisdot
21 Replies

9. Programming

Storing C++-struct in file - problem when adding new item in struct

Hi, I have received an application that stores some properties in a file. The existing struct looks like this: struct TData { UINT uSizeIncludingStrings; // copy of Telnet data struct UINT uSize; // basic properties: TCHAR szHost; //defined in Sshconfig UINT iPortNr; TCHAR... (2 Replies)
Discussion started by: Powerponken
2 Replies

10. UNIX for Dummies Questions & Answers

Defining variable problem

Hi I'd say I'm having this weird problem where my script isn't taking the value off a variable or printing it. My code is like this: set count_C= `grep -c C mols` set count_H= `grep -c H mols` set count_O= `grep -c O mols` sed -i '7,7 s/$/ $count_C $count_O $count_H/g' input It... (8 Replies)
Discussion started by: saleheen
8 Replies
XtAppSetTypeConverter(3)					   XT FUNCTIONS 					  XtAppSetTypeConverter(3)

NAME
XtAppSetTypeConverter, XtSetTypeConverter - register resource converter SYNTAX
void XtAppSetTypeConverter(XtAppContext app_context, String from_type, String to_type, XtConverter converter, XtConvertArgList con- vert_args, Cardinal num_args, XtCacheType cache_type, XtDestructor destructor); void XtSetTypeConverter(String from_type, String to_type, XtConverter converter, XtConvertArgList convert_args, Cardinal num_args, XtCa- cheType cache_type, XtDestructor destructor); ARGUMENTS
app_context Specifies the application context. converter Specifies the type converter procedure. convert_args Specifies how to compute the additional arguments to the converter or NULL. from_type Specifies the source type. num_args Specifies the number of additional arguments to the converter or zero. to_type Specifies the destination type. cache_type Specifies whether or not resources produced by this converter are sharable or display-specific and when they should be freed. destructor Specifies a destroy procedure for resources produced by this conversion, or NULL if no additional action is required to deallo- cate resources produced by the converter. DESCRIPTION
XtSetTypeConverter registers the specified type converter and destructor in all application contexts created by the calling process, including any future application contexts that may be created. XtAppSetTypeConverter registers the specified type converter in the single application context specified. If the same from_type and to_type are specified in multiple calls to either function, the most recent over- rides the previous ones. SEE ALSO
X Toolkit Intrinsics - C Language Interface Xlib - C Language X Interface X Version 11 libXt 1.0.5 XtAppSetTypeConverter(3)
All times are GMT -4. The time now is 11:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy