473,387 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

illegal indirections

Kev
Greetings all :o)

Pardon if my quickie code isnt exactly right. This is the classic 'you cant
do that' reference to a reference problem:

I am trying to avoid passing the class itself around... and from using
pointers. To get around the problem here is what I did. I havent been able
to really test this throughly as Im not ready to use it. But I am not
receiving any compile errors.

myclass a;
function1(a);

function1(myclass &b)
{
function2(myclass &b);
}

function2(myclass *c)
{
}

In function1 am I passing a pointer to 'a' to function2... without making
any duplicates of it?

cheers
Aug 15 '05 #1
4 1162
Kev wrote:
Greetings all :o)

Pardon if my quickie code isnt exactly right. This is the classic 'you cant
do that' reference to a reference problem:

I am trying to avoid passing the class itself around... and from using
pointers. To get around the problem here is what I did. I havent been able
to really test this throughly as Im not ready to use it. But I am not
receiving any compile errors.

myclass a;
function1(a);

function1(myclass &b)
{
function2(myclass &b);
}

function2(myclass *c)
{
}

In function1 am I passing a pointer to 'a' to function2... without making
any duplicates of it?


Yes. c will be a pointer to a.
Aug 15 '05 #2
Kev
Gianni Mariani <gi*******@mariani.ws> wrote in news:4bOdneUlkaORop3eRVn-
ig@speakeasy.net:
Yes. c will be a pointer to a.


Thank you. :o)
Aug 15 '05 #3
Kev wrote:
Greetings all :o)
myclass a;
function1(a);
You can't have non-declaration statements at file scope.
I'll assume that those 2 lines were in some function,
but the following code is back at file scope.

function1(myclass &b)
{
function2(myclass &b);
That's a syntax error. Perhaps you meant:

function2(&b);

which would do the same as function2(&a) instead of function1(a).
}

function2(myclass *c)
{
}


Aug 16 '05 #4
Kev
"Old Wolf" <ol*****@inspire.net.nz> wrote in news:1124160930.879273.28370
@g49g2000cwa.googlegroups.com:
function1(myclass &b)
{
function2(myclass &b);


That's a syntax error. Perhaps you meant:

function2(&b);

which would do the same as function2(&a) instead of function1(a).

Havent read posts here in about a week. Yes you are correct... which is how
it ended up in the end.

Thank you :o)

Now Im trying to figure out why a simple fout.close() would cause an access
error
Aug 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Frances Del Rio | last post by:
Pls, what are all illegal chars in e-mail addreses? specif. I'd like to know if apostrophe is allowed, but would be handy to find a list of all illegal chars for e-mail addresses.. searched...
14
by: deko | last post by:
Is there a way to check user input for illegal characters? For example, a user enters something into a text box and clicks OK. At that point I'd like to run code such as this: illegal =...
7
by: rs | last post by:
Just out of idle curiosity: 1)Regarding pointers; I don't have the standard/grammar with me, but T* for type T mean pointer-to-T. Does that mean that with a declaration of type T** is actually...
5
by: Dave | last post by:
I need to cut out illegal characters in a string submitted from a mobile phone to a web form. I need a way to check for the illegal characters in a textbox. I intend to loop through the text and...
0
by: Felix Finch | last post by:
I have a perl test program which has about 80 test cases, each of which creates its own schema so I can remove them with DROP SCHEMA xxx CASCADE. Normally each test case creates and drops the same...
2
by: Gabrielle A. Grün | last post by:
Hi All, Does anyone know a way around the illegal reference of a non-static member? Thanks. iNHERITANCE HIERACY
6
by: BlueTrin | last post by:
Hello I was adapting a C version of SolvOpt in C++ to use it within a virtual class. However I am stuck with the overriding of evaluation and gradiant functions. cStepCurveEvaluator.cpp...
1
by: Manish | last post by:
The code is as ... $folderlistfile = $path."xmlfile.xml"; /* <list> <details id="2"> <name>Books</name>
8
by: Just another C hacker | last post by:
Hello friends, I'm writing a program in C with some bits in inline asm for efficiency. I'd like to be able to handle illegal instructions from within asm. Here's an example of a standalone asm...
2
by: Kamaria | last post by:
I wrote this program to calculate the income tax of a user depending on whether or not they were married: import javax.swing.JOptionPane; public class Income_Tax { public static void main...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.