Hello All!
I`m still trying to wade through C++ and am now using VC++. I tried to run
a program and keep getting a message that says .....
"function1102506.cpp(23) : error C2448: 'print_out' : function-style initializer appears to be a function definition
Build log was saved at "file://i:\My Documents\Visual Studio 2005\Projects\function1102506\function1102506\Debu g\BuildLog.htm" "
Code:
#include <iostream>
#include "stdafx.h"
using namespace std;
// Function must be declared before being used.
void print_out(int n);
int n;
int main() {
int n;
cout << "Enter a number and press ENTER: ";
cin >> n;
print_out(n);
return 0;
}
// Print-out function.
// Prints numbers from 1 to n.
int print_out(n) {
int i;
for (i = 1; i <= n; i++) // For i = 1 to n,
cout << i << " "; // print i
return sum;
}
I have tried to make sure this is indented properly and all my programming "grammar" is correct. However since I am only starting I hope you will forgive any missteps.
I can`t find anything on the web that might clue me in and MSVC++ "Help" is no help. Thank You All for any advice. Plain