The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > UNIX Desktop for Dummies Questions & Answers
.
google unix.com



UNIX Desktop for Dummies Questions & Answers Discuss UNIX and Linux user interfaces like GNOME, KDE, CDE, and Open Office here. All UNIX and Linux Newbies Welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Problem with writing a program CompNoob UNIX for Dummies Questions & Answers 1 09-07-2008 05:00 AM
Need help on a program I'm writing dmosheye Shell Programming and Scripting 2 09-21-2006 04:39 PM
writing a program carlvernon UNIX for Dummies Questions & Answers 3 06-01-2006 04:47 PM
I'm writing a new Linux program! Danny_10 What's on Your Mind? 11 10-03-2004 11:09 PM
long doubles crashnburn High Level Programming 1 12-19-2002 11:12 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-12-2009
rickym2626 rickym2626 is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 5
need help writing a program to look for doubles

to determine if two two doubles are equal, we check to see if
their absolute difference is very close to zero. . .if two numbers
are less than .00001 apart, theyre equal.
keep a count field in each record (as you did in p5).
once the list is complete, ask the user to see if an element
is on the list--read her/his input from the keyboard.
here is what i got

code
#include "ll.h"
#include <stdio.h>
int main() {
int info;
lnode * head ;
head = getlist();
if (find(10, head)) fprintf("%d is on the list\n",10);
else fprintf("%d is not on the list\n",10);
if (find(178, head)) fprintf("%d is on the list\n",178);
printlist(head);
return 0;
}

also have a ll.h a makefile and a input file. but im just not understanding the program and how to start it.
  #2 (permalink)  
Old 04-13-2009
jim mcnamara jim mcnamara is online now Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,759
Can you compile the code?
  #3 (permalink)  
Old 04-13-2009
pludi's Avatar
pludi pludi is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2008
Location: .at
Posts: 1,866
Quote:
Originally Posted by rickym2626 View Post
[...]
keep a count field in each record (as you did in p5).
once the list is complete, ask the user to see if an element
is on the list--read her/his input from the keyboard.
Homework?
Quote:
Originally Posted by rickym2626 View Post
here is what i got
Code:
#include "ll.h"
#include <stdio.h>
int main()
{
    int info;
    lnode *head;
    head = getlist();
    if (find(10, head))
        fprintf("%d is on the list\n", 10);
    else
        fprintf("%d is not on the list\n", 10);
    if (find(178, head))
        fprintf("%d is on the list\n", 178);
    printlist(head);
    return 0;
}
I also have a ll.h, a makefile and an input file. But I'm just not understanding the program and how to start it.
Did you compile it? Does it have execute permissions (if needed)? What exactly aren't you understanding? Where did you get that code from?
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:23 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0