Home > request for > error request for member which is of non-class type struct

Error Request For Member Which Is Of Non-class Type Struct

Contents

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies

Request For Member Which Is Of Non Class Type Int

of this site About Us Learn more about Stack Overflow the company Business request for member which is of non class type c++ Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges

Request For Member Push_back In Which Is Of Non Class Type

Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: request for member size which is of non-class type Sign up C++ request for member, which is of non-class type up vote 0 down vote favorite I have a simple program. The main is provided by my professor. We're to write 3 functions called enter, simplify, display. main #include using namespace std; // #include "fraction.h" struct Fraction { int numerator; int denominator; }; void enter(struct Fraction* fraction); void simplify(struct Fraction* fraction); request for member which is of non-class type arduino void display(struct Fraction fraction); int main() { struct Fraction fraction; cout << "Fraction Simplifier" << endl; cout << "===================" << endl; enter(&fraction); //simplify(&fraction); //display(fraction); } void enter(struct Fraction* fraction) { cout << "Numerator: " << endl; cin >> *fraction.numerator; // the line that doesn't work, line 31 } void simplify(struct Fraction* fraction) {} void display(struct Fraction fraction) {} error: w2.cpp:31:19: error: request for member ânumeratorâ in âfractionâ, which is of non-class type âFraction*â the line in question void enter(struct Fraction* fraction) { cout << "Numerator: " << endl; cin >> *fraction.numerator; // the line that doesn't work, line 31 } c++ share|improve this question edited Jan 17 '13 at 23:43 Rapptz 14.4k34972 asked Jan 17 '13 at 23:30 eveo 1,12473060 Also, when you write in C++ it is better to use references than pointers in enter and simplify and const-reference in the display function. –Rafał Rawicki Jan 17 '13 at 23:34 add a comment| 4 Answers 4 active oldest votes up vote 4 down vote accepted You have an order of operations problem. You want: cin >> (*fraction).numerator Or more idiomatically: cin >>

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the

Request For Member Which Is Of Non Class Type Char

workings and policies of this site About Us Learn more about Stack c++ request for member which is of pointer type Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs

Request For Member Which Is Of Non-class Type Template

Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join http://stackoverflow.com/questions/14390043/c-request-for-member-which-is-of-non-class-type them; it only takes a minute: Sign up Request for member ______ which is of non-class type up vote 0 down vote favorite Good Day wonderful computer people of the planet Earth! Here is the struct in a file called AudioQueue.h: typedef struct AudioQueueBuffer { const UInt32 mAudioDataBytesCapacity; void * const mAudioData; UInt32 mAudioDataByteSize; void * mUserData; const UInt32 mPacketDescriptionCapacity; http://stackoverflow.com/questions/4885915/request-for-member-which-is-of-non-class-type AudioStreamPacketDescription * const mPacketDescriptions; UInt32 mPacketDescriptionCount; #ifdef __cplusplus AudioQueueBuffer() : mAudioDataBytesCapacity(0), mAudioData(0), mPacketDescriptionCapacity(0), mPacketDescriptions(0) { } #endif } AudioQueueBuffer; /*! @typedef AudioQueueBufferRef @abstract An pointer to an AudioQueueBuffer. */ typedef AudioQueueBuffer *AudioQueueBufferRef; And then later on there is this in the header of AudioPlayer.h: AudioQueueBufferRef mBuffers[kNumberBuffers]; And then what I'm trying to do: for (int i = 0; i < kNumberBuffers; ++i) { printf("%i\n", &mBuffers[i].mAudioData ); XThrowIfError(AudioQueueAllocateBufferWithPacketDescriptions(mQueue, bufferByteSize, (isFormatVBR ? mNumPacketsToRead : 0), &mBuffers[i]), "AudioQueueAllocateBuffer failed"); Basically I'm trying to access the information in mAudioData, but get the error: request for member 'mAudioData' in '((AQPlayer*)this)->AQPlayer::mBuffers[i]', which is of non-class type 'AudioQueueBuffer*' Any help greatly appreciated! c++ share|improve this question edited Feb 3 '11 at 12:16 kriss 13.7k105694 asked Feb 3 '11 at 12:06 Eric Brotto 25.9k1690152 Maybe it's an operator precedence error? Try -> instead of . to access mAudioData. –The-Kenny Feb 3 '11 at 12:11 add a comment| 2 Answers 2 active oldest votes up vote 7 down vote accepted AudioQueueBufferRef is an AudioQueueBuffer pointer. mBuffers is an array of these. So whe

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings http://stackoverflow.com/questions/10558156/error-request-for-member-which-is-of-non-class-type and policies of this site About Us Learn more about Stack https://bytes.com/topic/c/answers/907794-how-fix-error-request-member-non-class-type Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; request for it only takes a minute: Sign up error: request for member which is of non class type up vote 0 down vote favorite I am using forward declaration and now I am getting an error referring to the class that uses the forward declaration...so fInstance forward declares fConfig and then the Helper class (a namespace - used for global access request for member to functions) - getting t fConfig.h #ifndef FCONFIG_H #define FCONFIG_H #include #include #include #include #include #include #include #include #include "JWDSFork.h" //#include "fInstance.h" using namespace std; class fConfig { private: pid_t pid, w; public: pid_t cPid; string name; int group; int instanceId; int numInstance; int tries; bool reply; bool debug; bool service; bool currentlyRunning; time_t startTime; time_t endTime; string path; fConfig(); virtual ~fConfig(); void start(); string intToString(int); char* stringToChar(string); }; #endif // FCONFIG_H fInstance.h #ifndef FINSTANCE_H #define FINSTANCE_H //#include "fConfig.h" #include #include #include using namespace std; class fConfig; class fInstance { public: fConfig* config; pid_t pid; vector notes; vector times; fInstance(); virtual ~fInstance(); }; #endif // FINSTANCE_H Helper.h #ifndef HELPER_H #define HELPER_H #include #include #include #include #include #include #include #include #include "fInstance.h" using namespace std; namespace Helper { extern string APPDIR; bool errorCheck(int, char*); string charToString(char*, int); string longToString(unsigned long); bool Contains(vector, fInstance); string convertInt(int); string convertDouble(double); bool Read(int, char*, size_t); bool Write(int, char*, size_t); }; #endif // HELPE

Ask a Question Need help? Post your question and get tips & solutions from a community of 418,544 IT Pros & Developers. It's quick & easy. How to fix error: "request for member which is of non-class type"? P: 19 kino Hello, I am getting the following error 25 C:\Dev-Cpp\main.cpp request for member `no' in `one', which is of non-class type `box[12]' in the code Expand|Select|Wrap|Line Numbers while(!myfile.eof()) { for(inti=0;i<12;i++) { myfile>>one.no[i]; } } where 'one' is an object of struct type 'box' and 'no' is the variable inside the struct. The above bit of code is just the simplified version of my complete code but basically I declared an array of struct type 'box' (size=12) , named it 'one', and am currently reading some numbers from a file into the variable 'no' of the struct. I would be grateful if someone could let me know the source of the error. Thanks. Feb 7 '11 #1 Post Reply ✓ answered by newb16 this .... here 'one' is an object of struct type 'box' and this... I declared an array of struct type 'box' (size=12) , named it 'one', ... are different things. The first one has the member 'no' that can be accessed as one.no ; the second is an array and has to be accessed like one[1].no Share this Question 2 Replies 100+ P: 687 newb16 this .... here 'one' is an object of struct type 'box' and this... I declared an array of struct type 'box' (size=12) , named it 'one', ... are different things. The first one has the member 'no' that can be accessed as one.no ; the second is an array and has to be accessed like one[1].no Feb 7 '11 #2 reply P: 19 kino Oh! Thanks a lot! :) Feb 7 '11 #3 reply Message Cancel Changes Post your reply Join Now >> Sign in to post your reply or Sign up for a free account. Similar topics Getting Error(#Error) in Report ... after converting Access2003 to 2007 Getting error 500 internal server error Trying to mount windows folder on Linux - getting error getting error when calculating total using unbound text field in subform Getting Error when Service account of WCF Service is a new account Getting error while setting session value Went from using Visual Web Develop express to Visual Studio 2005 and getting error when trying to open project Getting error 'The underlying connection was closed: The server committed an HTTP protocol violation' Error: Request timed out. Getting error message 'HTTP/1.1 500 Internal Server Error' on development machine Browse more C / C++ Questions on Bytes Question stats viewed: 4293 replies: 2 da

 

Related content

arduino error request for member which is of non-class type

Arduino Error Request For Member Which Is Of Non-class Type table id toc tbody tr td div id toctitle Contents div ul li a href Request For Member Which Is Of Non Class Type C a li li a href Request For Member Size Which Is Of Non-class Type a li li a href Request For Member Which Is Of Non-class Type char a li ul td tr tbody table p Programming Questions Request for member ' ' in ' ' which is of non class relatedl type ' ' Print Go Down Pages Topic request for member which is

error based request anc apporval

Error Based Request Anc Apporval table id toc tbody tr td div id toctitle Contents div ul li a href Request Approval Failed Error In Msmp Approval Method a li li a href Request For Approval Email a li li a href Request For Approval Letter Format a li li a href Request For Approval Of Excused Absence For Physical Fitness a li ul td tr tbody table p the Business Request if applicable Add or modify supporting documents as relatedl attachments for the Business Request Select information for p h id Request Approval Failed Error In Msmp Approval Method

error request for member which is of non-class type nt

Error Request For Member Which Is Of Non-class Type Nt table id toc tbody tr td div id toctitle Contents div ul li a href Request For Member Which Is Of Non Class Type Char a li li a href Request For Member In Something Not A Structure Or Union a li li a href Void Is Not A Pointer To Object Type a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to relatedl any questions you might have Meta Discuss the workings request for member size which is

error request for member ush_backin which is of non-class type

Error Request For Member Ush backin Which Is Of Non-class Type table id toc tbody tr td div id toctitle Contents div ul li a href Request For Member Which Is Of Non-class Type C a li li a href Request For Member Which Is Of Non-class Type Struct a li li a href Request For Member Which Is Of Non Class Type Char a li li a href Request For Member Which Is Of Non-class Type Template a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any

error request for member which is of non-class type c

Error Request For Member Which Is Of Non-class Type C table id toc tbody tr td div id toctitle Contents div ul li a href Non Class Type Error a li li a href Request For Member Which Is Of Non-class Type Arduino a li li a href C Request For Member Which Is Of Pointer Type a li li a href Request For Member In Something Not A Structure Or Union a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers relatedl to any questions you might have Meta

gcc error request for member which is of non-class type

Gcc Error Request For Member Which Is Of Non-class Type table id toc tbody tr td div id toctitle Contents div ul li a href Request For Member Size Which Is Of Non-class Type a li li a href Request For Member Which Is Of Non-class Type char a li li a href Request For Member In Something Not A Structure Or Union a li ul td tr tbody table p here for a quick overview relatedl of the site Help Center Detailed answers non class type error to any questions you might have Meta Discuss the workings p h

magic online error reporting

Magic Online Error Reporting table id toc tbody tr td div id toctitle Contents div ul li a href Mtgo Known Bugs a li li a href Request Reimbursement Letter a li li a href Mtgo Twitter a li li a href Mtgo Server Status a li ul td tr tbody table p Select a product Search Tips Search Magic Online Report an Issue Answer ID Requires wizards com login If you encounter an issue with Magic Online we would like to know about it relatedl If you were in a Magic Online tournament we may be able p h

mscorlib permission error

Mscorlib Permission Error table id toc tbody tr td div id toctitle Contents div ul li a href System security permissions securitypermission Mscorlib Version Culture neutral a li li a href System security permissions fileiopermission Failed a li li a href Securitypermission C a li ul td tr tbody table p ASP NET Community relatedl Standup Forums Help Home ASP NET Forums Advanced ASP NET Crystal request for the permission of type system security permissions securitypermission mscorlib failed Reports Error Request for the permission of type p h id System security permissions securitypermission Mscorlib Version Culture neutral p 'System Security

non class type error

Non Class Type Error table id toc tbody tr td div id toctitle Contents div ul li a href Request For Member Which Is Of Non-class Type Arduino a li li a href C Request For Member Which Is Of Pointer Type a li li a href Undefined Reference To Class a li ul td tr tbody table p here for a quick relatedl overview of the site Help Center Detailed request for member size which is of non-class type answers to any questions you might have Meta Discuss the p h id Request For Member Which Is Of Non-class

of non class type error

Of Non Class Type Error table id toc tbody tr td div id toctitle Contents div ul li a href Request For Member Which Is Of Non-class Type char a li li a href Request For Member In Something Not A Structure Or Union a li li a href Undefined Reference To Class a li ul td tr tbody table p here for a quick relatedl overview of the site Help Center Detailed request for member size which is of non-class type answers to any questions you might have Meta Discuss the request for member which is of non-class type

permissions fileiopermission error

Permissions Fileiopermission Error table id toc tbody tr td div id toctitle Contents div ul li a href System security permissions securitypermission Mscorlib Version Culture neutral a li li a href System security permissions fileiopermission Failed a li li a href Trust Level Full a li ul td tr tbody table p Forum C Programming C-Sharp Programming RESOLVED System Security Permissions SecurityPermission error If this is your first visit be sure to check out relatedl the FAQ by clicking the link above You may have request for the permission of type system security permissions securitypermission mscorlib to register or Login

permissions securitypermission error

Permissions Securitypermission Error table id toc tbody tr td div id toctitle Contents div ul li a href System security permissions securitypermission Mscorlib Version Culture neutral a li li a href trust Level full a li li a href Unable To Read The Security Policy File For Trust Level full a li ul td tr tbody table p Forum C Programming C-Sharp Programming RESOLVED System Security Permissions SecurityPermission error If this is your first visit be sure relatedl to check out the FAQ by clicking the link above request for the permission of type system security permissions securitypermission mscorlib You

qt error request for member which is of non-class type

Qt Error Request For Member Which Is Of Non-class Type table id toc tbody tr td div id toctitle Contents div ul li a href Non Class Type Error a li li a href Request For Member Which Is Of Non-class Type Arduino a li li a href C Request For Member Which Is Of Pointer Type a li li a href Request For Member In Something Not A Structure Or Union a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any relatedl questions you might have Meta