473,396 Members | 1,913 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,396 software developers and data experts.

Newbie Help! - "Request for member ' ' in something not a structure or a union"

*I'm a complete beginner to programming! Also I'm coding on a Mac with Xcode so it's Objective C [if that makes any difference]*

This error keeps coming up everytime I try to build and I have no idea how to remedy it. Any thoughts?

Code:

Expand|Select|Wrap|Line Numbers
  1. #import <Foundation/Foundation.h>
  2.  
  3. typedef struct {
  4.     int alpha;
  5.     int beta;
  6.     int delta;
  7. } greek;
  8.  
  9. greek letters;
  10.  
  11. void tester1 (int value) {    
  12.  
  13.     letters.beta *= letters.delta;
  14. };
  15.  
  16. void tester2 (int letters) {
  17.  
  18.     letters += letters.beta;  <<- Error appears in this line
  19.  
  20. };    
  21.  
  22. int main (int argc, const char * argv[]) {        
  23.  
  24.     letters.alpha = 8;
  25.     letters.beta = 4;
  26.     letters.delta = 22;        
  27.  
  28.     tester2(letters.alpha);
  29.     NSLog(@"answer equal to %f", letters.alpha, letters.beta);
  30.  
  31.     return 0;
  32. }
May 10 '12 #1
1 2906
Rabbit
12,516 Expert Mod 8TB
You've declared letters twice. You have a greek letters and an int letters.
May 10 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jeff Massung | last post by:
I am having a syntax issue that I hope someone else here knows how to rectify... I am loading an INI file and have a simple function to load values from it. The function is overloaded with the...
14
by: Steven Taylor | last post by:
I'm learning C++ from C++ Primer Plus 5th edition. I'm struggling at the moment with declaring an array of three structures by using 'new' to allocate memory. (this is one of the programming...
10
by: junky_fellow | last post by:
I am trying to print the offset of a particulat member in a structure, but it's not working. I am using the following expression to print the offset. &(struct my_struct *)0->member_name ...
3
by: ~~~ .NET Ed ~~~ | last post by:
Hello, I am having a problem trying to serialize this simple structure, I use it in a collection class that derives from CollectionBase but I noticed that at least for now the serialization...
1
by: | last post by:
I'm having trouble with this code...It won't loop though each value any one know why? TIA Public Class TestData Public Structure Element Dim eName As String Dim eN1 As String Dim eN2 As...
3
by: Dongsheng Ruan | last post by:
Not quite related with Python. But my Data Structure course is experiemented on python and there is no data structure group, So I have to post here: Write a procedure (in pseudocode!) to increase...
5
by: lovecreatesbea... | last post by:
Does the expression *(int *)&s1 below inside the printf() statement guarantee to refer to the first member of the structure variable s1? I've tried the code and it seems that it works that way. The...
3
by: frankleggett | last post by:
Hi I am a bit confused why this if then statement doesn't work. If InStr(Result(12), "CF") Or InStr(Result(12), "cf") And Result(2) <> "1st=" Then GoTo WinnerCF If InStr(Result(12), "CF") Or...
17
by: abhimanyu.v | last post by:
Hi Guys, I have one doubt. The test program is given below. It uses two way of finding out the offset of a variable in structure. I executed the program and found the same result. My question...
3
by: trfilmographer | last post by:
Hi fellow web developers! I have a little problem due to my lack of javascript / web developing skills... Basically I have a form embedded in a table. WHat I would like to do, is have the...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.