[solved]help passing array of structs to function in c
this is my code to try and prinnt out a deck of cards. the print function worked when used inside main without being a function but now i cant get it to work as a function probably since i dont know how to pass a struct array in c. I gave it a shot but i keep getting an assortment of errors. The structure is called card_t and it has a number variable and suit variable which is an enum type.
if anyone could please tell me what i can do to let the struct pass into the print function accurately i would greatly appreciate it.
NVM i actually figured it out myself. just had to remove struct from prototype and function def. thanks anyway
Passing a array to a function, a basic feature in modern language, seems to be only possible in KSH. Not in BASH. Depite all my efforts I couldn't come to a solution. See the following examples:
It works perfectly in KSH:
#!/usr/bin/ksh
function print_array {
# assign array by indirect... (3 Replies)
Hi ,
I have three funcions f1, f2 and f3 .
f1 calls f2 and f2 calls f3 .
I have a global variable "period" which i want to pass to f3 .
Can i pass the variable directly in the definition of f3 ?
Pls help .
sars (4 Replies)
Hi All,
I have some questions regarding array arguements passing for Perl Function.
If @array contains 2 items , arguements passing would be like Code_A.
But what if @array needs to add in more items, the rest of the code like $_ will have to be modified as well (highlighted in red), which is... (5 Replies)
Hi,
I'm trying to write a function that reassigns an array to
another local array but the method used in reassigning
the array reformats the contents of the array which is
what I am trying to prevent.
The method used to load a file into an array works as
expected and the entire array is... (4 Replies)
EDIT: Nevermind, called a friend who is good at this stuff and he figured it out :D
Hi all,
So I'm trying to teach myself to write programs for unix in c. I am currently creating a program, and I need to pass a struct through a pipe, but I can't figure out how.
The struct I want to pass... (0 Replies)
Hi.
I have a problem with passing two dimensional array to a function.
First, let me show my code to explain what i am going to do:
I have function:void initialize_board(char board);which is supposed to modify content of passed array. I have read here: Question 6.18 how such arrays should be... (3 Replies)
Hey guys!
First of all english is not my main language so sorry for any english mistakes.
Second im a total beginner in programming, still i have a school work to do and i found a problem. Probably something easy to solve but it's driving me crazy.
So i created a struct, that holds 4 ints:
... (1 Reply)
Hey guys!
First of all english is not my main language so sorry for any english mistakes.
Im from Portugal!
1. The problem statement, all variables and given/known data:
Im having a problema creating and array of structs for a work i need to do. (xLib)
2. Relevant commands, code,... (1 Reply)
Hi All
I have multiple arrays like below.
set -A val1 1 2 4 5
set -A val2 a b c d
.
.
.
Now i would like to pass the individual arrays one by one to a function and display/ do some action.
Note : I am using ksh
Can you please advise any solution...
Thanks in advance. (7 Replies)
Hello All,
I would like to ask help from you on how to pass variable value from a function that has been called inside the function. I have created below and
put the variables in " ". Is there another way I can do this? Thank you in advance.
readtasklist() {
while read -r mod ver... (1 Reply)
Discussion started by: aderamos12
1 Replies
LEARN ABOUT DEBIAN
if_sn
SN(4) BSD Kernel Interfaces Manual SN(4)NAME
sn -- Ethernet driver for SMC91Cxx based cards
SYNOPSIS
To compile this driver into the kernel, place the following lines in your kernel configuration file:
device sn
Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5):
if_sn_load="YES"
DESCRIPTION
The sn device driver supports SMC91Cxx based ISA and PCMCIA cards.
HARDWARE
The sn driver supports SMC91Cxx based ISA and PCMCIA cards including:
o 3Com Megahertz X-Jack Ethernet PC Card XJ10BT, XJ10BC
o 3Com Megahertz XJEM and CCEM series: CCEM3288C, CCEM3288T, CCEM3336, CEM3336C, CCEM3336T, XJEM1144C, XJEM1144T, XJEM3288C, XJEM3288T,
XJEM3336
o Farallon EtherMac PC Card 595a
o Motorola Mariner Ethernet/Modem PC Card
o Ositech Seven of Diamonds Ethernet PC Card
o Ositech Jack of Hearts Ethernet/Modem PC Card
o Psion Gold Card Netglobal Ethernet PC Card
o Psion Gold Card Netglobal 10/100 Fast Ethernet PC Card
o Psion Gold Card Netglobal 56k+10Mb Ethernet PC Card
o SMC EZEther PC Card (8020BT)
o SMC EZEther PC Card (8020T)
The sn driver supports the SMC 91C90, SMC 91C92, SMC 91C94, SMC 91C95, SMC 91C96, SMC91C100 and SMC 91C100FD chips from SMC.
The Farallon EtherWave and EtherMac card came in two varieties. The ep(4) driver supports the 595 and 895 cards. These cards have the blue
arrow on the front along with a 3Com logo. The Farallon 595a cards, which have a red arrow on the front, are also called EtherWave and
EtherMac. They are supported by the sn driver.
SEE ALSO ed(4), ep(4), ie(4), intro(4), ng_ether(4), vx(4), ifconfig(8)HISTORY
The sn device driver appeared in FreeBSD 4.0.
BSD July 16, 2005 BSD