0

Hello World,
I'm a c++ beginner and i've diced to study. So this is my first code:

#include <iostream>
using namespace std;

double d = 2.2;
int i = 7;

void some_function()
{
	d = d + i;
	i = d * i;
	printf("%d\n", d);
	printf("%d\n", i);

}


int main(){
	return 0;
}

when i try to compile this, i get this answer:
a.cpp: In function ‘void some_function()’:
a.cpp:11: error: ‘printf’ was not declared in this scope

It's a elementary mistake but i can't see. If you can help me...

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by Igor Vinícius
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.