2 questions
1. I now the compiler i am using is outdated, Its turbo c++ version 3.0 so i want to know what changes do i need to make to make my program run on new c++ compilers
2. In line no. 10 I am getting an error:- Constant expression required. I know why it is happening but i just waana ask is there any way to get away with this problem??
i want to know what changes do i need to make to make my program run on new c++ compilers
1 2
#include<iostream.h>
#include<iostream>
There is no iostream.h in standard C++
#include<conio.h> Avoid it. It is non-standard, outdated and often unsupported
1 2
void main()int main()
Main shall return int. By Standard.
1 2 3 4 5
int prime(long);//←\
// |
int main() // |
{ // |
int prime(int);// -/
Although declaration of functions inside functions is technically legal, do not do this. Also you have declaration mismatch definition. int and long are different
i just waana ask is there any way to get away with this problem??
1) read this article: http://www.cplusplus.com/forum/articles/17108/
2) In this concrete case vector of pairs would suit you if your compiler support it: std::vector<std::pair<long, long>>