I have a function that returns an int. How can I call it from the main function.
mrjoli021
-3
Junior Poster
Recommended Answers
Jump to Post#include <stdio.h> int functionname(int value1,int value2); int main() { int a; int parameter1,parameter2; a = functionname(parameter1,parameter2);//If you want to store the value in a variable which is returned by the function... functionname(parameter1,parameter2);//If you want to call the function only.... return 0; } int functionname(int value1,int value2) { …
All 2 Replies
Reply to this topic
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.