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
ppmtosixel(1)						      General Commands Manual						     ppmtosixel(1)

NAME
ppmtosixel - convert a portable pixmap into DEC sixel format SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile] DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC LJ250 color inkjet printer. If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file. OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com- pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni- tude larger than a compressed file and prints much slower. -margin If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci- fied, a 1.5 inch left margin will offset the image. PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?. BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation. SEE ALSO
ppm(5) AUTHOR
Copyright (C) 1991 by Rick Vinci. 26 April 1991 ppmtosixel(1)
All times are GMT -4. The time now is 02:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy