Thread: How to send a ppm to a function?

  1. #1
    Registered User
    Join Date
    Apr 2015
    Posts
    11

    Unhappy How to send a ppm to a function?

    I need to send a ppm image to a function in another file that is suppose to print the new altered ppm image trouble is I'm stuck and can't figure out how just yet any help is greatly appreciated.

    Code:
    #include "transform.h"
    
    int print(void){
    
        FILE *inFile
    
    
        inFile - fopen("tiger.ppm", "r");
        if(!inFile){
            fprintf(stderr, "File open error. Exiting program\n");
            exit(1);
        }
    }

  2. #2
    Registered User Alpo's Avatar
    Join Date
    Apr 2014
    Posts
    877
    Generally, you will want to create a data structure that holds all the fields of the image, then you can pass a pointer to this structure around (also you can create functions for loading/saving/manipulating the structure). I'm not familiar with .PPM, I did find a site listing it's format though:

    CS35: Lab 1 - PPM Image Format
    WndProc = (2[b] || !(2[b])) ? SufferNobly : TakeArms;

  3. #3
    Registered User
    Join Date
    Apr 2015
    Posts
    11
    Sorry but that doesn't tell me much

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,738
    You didn't tell us what your problem actually is, which should be more than just "I'm stuck, help me solve this."
    Where are you stuck, and why? What can you do? Is opening the file all you can do? If that is so, then the link @Alpo gave you should tell you quite a few things.

    Unless of course you came here expecting to get a solution... That ain't gonna happen, mate.
    Devoted my life to programming...

  6. #6

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How do I send pointers into this function?
    By scarlet00014 in forum C Programming
    Replies: 4
    Last Post: 10-15-2008, 12:10 PM
  2. problem with send function
    By neandrake in forum Networking/Device Communication
    Replies: 3
    Last Post: 09-15-2006, 11:13 AM
  3. A function that takes and send a pointer
    By JeremyCAFE in forum C++ Programming
    Replies: 15
    Last Post: 12-23-2005, 03:40 PM
  4. please send me the function name
    By mazhar in forum Tech Board
    Replies: 3
    Last Post: 04-29-2004, 11:14 AM
  5. one function to send them all
    By WebmasterMattD in forum C++ Programming
    Replies: 2
    Last Post: 12-13-2002, 08:22 AM

Tags for this Thread