why doesnt this compile correctly


 
Thread Tools Search this Thread
Top Forums Programming why doesnt this compile correctly
# 1  
Old 09-09-2004
Question why doesnt this compile correctly

hello there

when i try and compile i keep getting this error that 'error C2115: 'function' : incompatible types' on the following line of the code:

for (i = 0; i < nCommands; ++i) {

printf(" Command[%d]: \n", i);
printComStruct(com[i]); // HERE

}

the following is my printComStruct function:

void printComStruct(struct command *com) { /* print function */

int i;

fprintf(stderr,"com_pathname=%s\n", com->com_pathname);
fprintf(stderr,"argc=%d\n", com->argc);

for(i=0; com->argv[i]!=NULL; i++)

fprintf(stderr,"argv[%d]=%s\n", i, com->argv[i]);

fprintf(stderr,"#######\n");

if (com->redirect_in == NULL)
fprintf(stderr,"redirect_in=NULL\n");

else
fprintf(stderr,"redirect_in=%s\n", com->redirect_in);

if (com->redirect_out == NULL)
fprintf(stderr,"redirect_out=NULL\n");

else
fprintf(stderr,"redirect_out=%s\n", com->redirect_out);

fprintf(stderr,"com_suffix=%c\n\n", com->com_suffix);

} /*end of function*/


can anyone please help. cheers

mile
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

Doesnt allow me to use [CODE] tags

Just got penalised for not performing a feature that didnt work for me. I tried to edit the post twice to add code tags, both manually and via button did not work. code - manual code - button (7 Replies)
Discussion started by: 06s23
7 Replies

2. UNIX for Dummies Questions & Answers

why doesnt it work?

I am trying to print out two fields in a file using awk. So, I have got awk -F '\t' 'NF = 2 {print $1 $2 "]"}' two.txt in a script called what.awk When i run this version like this - ./what.awk then it runs however I want to run the program like this awk -f what.awk two.txt. When I... (8 Replies)
Discussion started by: The undertaker
8 Replies

3. AIX

Vi doesnt work

Hi Guys, I have a strange problem.( AIX 6.1) "vi" is not working at all..Whenever i #vi <anythin> ,, it returns the prompt back. Any clues folks?? (14 Replies)
Discussion started by: muzahed
14 Replies

4. UNIX for Dummies Questions & Answers

Compiling gcc to compile make to compile yaboot

I have just installed OpenBSD on a 333MHz PPC iMac G3. It has a 6GB HDD that has been partitioned as 1GB MacOS 8.5.1, 3GB MacOS X 10.3.9, 2GB OpenBSD 4.8. I now need to install a bootloader so that my computer can recognize the OpenBSD partition at startup. I have been trying to install... (0 Replies)
Discussion started by: t04st3r
0 Replies

5. Shell Programming and Scripting

compiler doesnt work

this is my file I have written. // My first C++ program #include <iostream> int main() { std::cout << "Hi there!" << std::endl"; std::cout << "This is my first C++ program" << std::endl"; return(0); } This is the error I get, why? $ g++ first.cpp ksh: g++: not found (1 Reply)
Discussion started by: gustave
1 Replies

6. Shell Programming and Scripting

loop doesnt work

It just does the break...even though the files are not the same... # Compare extracts #========================================== count=0 while (( count < 5 )) do (( count+=1 )) echo "Try $count" file1=$(ls -l /tmp/psjava.xml|... (5 Replies)
Discussion started by: sigh2010
5 Replies

7. Red Hat

ldapsearch doesnt work.

Hii All, I am using openldap v2.3 on redhat El-4. When i run ldapsearch it returns all the entries. The command runs successfully. But when I run the ldapsearch with following filter option it doesnt work and immediately returns to the shell. ldapsearch uidNumber>=2000 I've started slapd... (0 Replies)
Discussion started by: shamik
0 Replies

8. UNIX for Dummies Questions & Answers

Terminal doesnt start

Hi everyone, I'm pretty new using UNIX, but a friend of mine was helping me configure the unix terminal on my mac, and he changed some stuff on the bash profile .bash_profile. Everything was going well until I shut my computer and restarted it. When I opened the terminal this time this is what... (1 Reply)
Discussion started by: thefloydpink
1 Replies

9. UNIX for Dummies Questions & Answers

cp doesnt work - Help

When trying to copy a file in Solaris 8 it doesnt copy file or give a error. This worked 100% until the 29th. I've checked the rights and everything seems fine: drwxrwxrwx 2 bmuser bmgroup 11776 Jan 3 10:32 spool This is the file I want to copy: -rwxrwxrwx 1 bmuser bmgroup ... (26 Replies)
Discussion started by: rudi.okelly
26 Replies

10. UNIX for Dummies Questions & Answers

cd.. doesnt work

hi when i want to go to previous directory by typing cd.. i get the following message $ cd.. ksh: cd..: not found Please help rintingtong (2 Replies)
Discussion started by: rintingtong
2 Replies
Login or Register to Ask a Question
NET-COMPILE(8)						      System Manager's Manual						    NET-COMPILE(8)

NAME
netscript-compile - netscript ipfilter-defs compile back end. SYNOPSIS
netcript-compile [ -fhq ] [ -b max-backup-level ] DESCRIPTION
This manual page documents briefly the netscript-compile command from the netscript router/firewall network configuration package. This command is the back end to the netscript compile command documented in netscript(8) manpage. See ipfilter-defs(5) for the details on the definitions files in /etc/netscript/ipfilter-defs. By default it checks to see if the relevant files in the /etc/netscript/ipfilter-defs directory have been updated by comparing their modi- fication times to that of /etc/netscript/ipfilter-defs.conf, and if updating is needed, it recompiles and re-creates the file. Up to max- backup-levels of history are kept of previously compiled /etc/netscript/ipfilter-defs.conf files, with a numeric extention in order of increasing age. OPTIONS
-b max-backup-level Sets the maximum level of backups kept of previously compiled files. This defaults to 2 (see /etc/netscript/netscript-com- pile.conf), and it is also used by the netscript(8) compile command. -f Force compile even though compile file is up to date with definitions. The testing depends on the modification times of the defini- tion file inodes in the file system. -h Show a summary of options. -q Quiet compile. This option suppresses informational progress messages. FILES
/etc/netscript/ipfilter-defs.conf, /etc/netscript/ipfilter-defs-compiled.conf, /etc/netscript/ipfilter-defs directory. SEE ALSO
ipfilter-defs(5), netscript(8). AUTHOR
This manual page was written by Matthew Grant <grantma@anathoth.gen.nz>, for the Debian GNU/Linux system (but may be used by others). BUGS
I wrote this manpage when I was not half asleep... March 25, 2003 NET-COMPILE(8)