Hey all! Here's my code:

mm.cc:

int compute(int f, int c)
{
        return f + c;
}

mm.h:

#ifndef MM_H
#define MM_H

int compute(int f, int c);

#endif

main.cc:

#include <stdio.h>
#include "mm.h"

int main()
{
        int a;
        a = compute(10, 4);
        printf("Output: %d\n", a);
        return 0;
}

Then, to run it, I tried using both "g++ main.cc" and "gcc main.cc". Neither worked. I'm pretty certain there's nothing wrong with the code, so guess i'm probably compiling it wrong. Can someone please help me out?! I've been stuck on this for waaay too long!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.