Sponsored Content
Full Discussion: Struct as return type
Top Forums Programming Struct as return type Post 302933786 by emily on Monday 2nd of February 2015 09:58:02 AM
Old 02-02-2015
Struct as return type

Hello all,
I am trying to define a function with return type as struct, but seem to be failing.

Error I am receiving is following

Code:
.CC error: prototype for 'RpcHOData L1ITMu::MBLTCollection::getUnassociatedHORpcClusters(double)' does not match any in class 'L1ITMu::MBLTCollection'
 struct RpcHOData L1ITMu::MBLTCollection::getUnassociatedHORpcClusters( double minRpcPhi ) 
                  ^
In file included from .h error: candidate is: L1ITMu::MBLTCollection::RpcHOData L1ITMu::MBLTCollection::getUnassociatedHORpcClusters(double)
      struct RpcHOData  getUnassociatedHORpcClusters( double minDist);

Please find the snippet of the code here:
Code:
in .h file --->

namespace L1ITMu {
  class MBLTCollection {

  public:

    struct RpcHOData {
      std::vector< L1ITMu::TriggerPrimitiveList> In;
      std::vector< L1ITMu::TriggerPrimitiveList> Out;
      std::vector< L1ITMu::TriggerPrimitiveList> ho;
    };

}

in CC file --->

struct RpcHOData L1ITMu::MBLTCollection::getUnassociatedHORpcClusters( double minRpcPhi )
{
 .....
 ......
}


Any piece of suggestions would be great.

Thanks in advance,
emily

---------- Post updated at 09:44 AM ---------- Previous update was at 09:40 AM ----------

I forgot to add,
I also tried removing the keyword 'struct' in the return type, did not help either.

Code:
in CC file --->

 RpcHOData L1ITMu::MBLTCollection::getUnassociatedHORpcClusters( double minRpcPhi )
{
 .....
 ......
}

error is then:
Code:
.CC error: 'RpcHOData' does not name a type
 RpcHOData L1ITMu::MBLTCollection::getUnassociatedHORpcClusters( double minRpcPhi )

---------- Post updated at 09:58 AM ---------- Previous update was at 09:44 AM ----------

resolved..Smilie Smilie

the issue was the scope in ,cc file
 

8 More Discussions You Might Find Interesting

1. Programming

Help - Cast converts default int return type

What does the warning message 724 "Cast converts default int return type to." tell me. I am new to C. (used it some in college). We are migrating our c-code to 10.2.0.3.0. The programs compiled clean. However there were several warning messages that kick out. The most prominent warning is: ... (5 Replies)
Discussion started by: rtgreen
5 Replies

2. Programming

array type has incomplete element type

Dear colleagues, One of my friend have a problem with c code. While compiling a c program it displays a message like "array type has incomplete element type". Any body can provide a solution for it. Jaganadh.G (1 Reply)
Discussion started by: jaganadh
1 Replies

3. Shell Programming and Scripting

Find command return type

Hi all does find command return anything if the file to be searched is not found? Like if I search from a file in a dir does it return false or null if the file is not found? Please suggests. (3 Replies)
Discussion started by: Veenak15
3 Replies

4. 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

5. Shell Programming and Scripting

what is the default return type of localtime() in perl?

Hi, I have given like this to get the time of the sub routine. my $start = localtime(); print "\n start time: $start \n"; Output start time: Fri Apr 29 01:01:31 2011 I want to know what is the format of the time. I am not able to follow is is HH:MM:SS or MM:HH:SS os... (2 Replies)
Discussion started by: vanitham
2 Replies

6. HP-UX

struct utsname throwing error : Value too large to be stored in data type

Hi, I am trying to fetch sysname and nodename using struct utsname. I have two HP-UX servers on with 10 characters and other with 13 characters host name. For the first one I am getting truncated 8 characters as output but for the second one i am getting "Value too large to be stored in data type"... (1 Reply)
Discussion started by: shivarajbm
1 Replies

7. Programming

Problem with implementing the times() function in C (struct tms times return zero/negative values)

Hello, i'm trying to implement the times() function and i'm programming in C. I'm using the "struct tms" structure which consists of the fields: The tms_utime structure member is the CPU time charged for the execution of user instructions of the calling process. The tms_stime structure... (1 Reply)
Discussion started by: g_p
1 Replies

8. 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
scrl(3XCURSES)						  X/Open Curses Library Functions					    scrl(3XCURSES)

NAME
scrl, scroll, wscrl - scroll a window SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib -R /usr/xpg4/lib -lcurses [ library... ] c89 [ flag... ] file... -lcurses [ library... ] #include <curses.h> int scrl(int n); int scroll(WINDOW *win); int wscrl(WINDOW *win, int n); PARAMETERS
n number and direction of lines to scroll win pointer to the window in which to scroll DESCRIPTION
The scroll() function scrolls the window win up one line. The current cursor position is not changed. The scrl() and wscrl() functions scroll the window stdscr or win up or down n lines, where n is a positive (scroll up) or negative (scroll down) integer. The scrollok(3XCURSES) function must be enabled for these functions to work. RETURN VALUES
On success, these functions return OK. Otherwise, they return ERR. ERRORS
None. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
clearok(3XCURSES), libcurses(3XCURSES), attributes(5), standards(5) SunOS 5.10 5 Jun 2002 scrl(3XCURSES)
All times are GMT -4. The time now is 05:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy