Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 08-20-2005, 04:17 AM   #1
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, 05:46 AM   #2
Registered: Jan 2005
Distribution: Archlinux, Debian, grml
Posts: 210

Rep: Reputation: 33
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, 10:59 PM   #3
Senior Member
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 46
traene: the latter.

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

void f(point_t* p);


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 12:14 PM
How can we pass arguments to installpkg ? frenchi Slackware 3 04-23-2004 07:43 PM
C Function Arguments jpbarto Programming 6 04-23-2004 02:59 PM
Function accept() and its arguments. krajzega Programming 1 01-20-2004 02:26 AM
wine doesn't pass arguments correctly when calling programs jonchapman Linux - Software 0 10-08-2003 02:56 PM

All times are GMT -5. The time now is 10:04 AM.

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