LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-20-2005, 03:17 AM   #1
ssg14j
LQ Newbie
 
Registered: Jul 2005
Posts: 12

Rep: Reputation: 0
How to pass structure as function arguments


How to pass structure as function arguments , with pointers in c..
give me one example.
 
Old 08-20-2005, 04:46 AM   #2
traene
Member
 
Registered: Jan 2005
Distribution: Archlinux, Debian, Centos
Posts: 222

Rep: Reputation: 35
struct point {
int x, y;
};

void f(point* p);
or maybe

void f(struct point* p);
 
1 members found this post helpful.
Old 08-20-2005, 09:59 PM   #3
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 47
traene: the latter.

one can also
Code:
typedef struct point {
  int x, y;
} point_t;

void f(point_t* p);
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to pass arguments from $prompt for php script ukjairaj Linux - Software 4 06-25-2004 11:14 AM
How can we pass arguments to installpkg ? frenchi Slackware 3 04-23-2004 06:43 PM
C Function Arguments jpbarto Programming 6 04-23-2004 01:59 PM
Function accept() and its arguments. krajzega Programming 1 01-20-2004 01:26 AM
wine doesn't pass arguments correctly when calling programs jonchapman Linux - Software 0 10-08-2003 01:56 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration