Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » C++ language problems and code snippets » strange MinGw return
Re: strange MinGw return [message #55418 is a reply to message #55409] Mon, 09 November 2020 20:06 Go to previous messageGo to previous message
Leander is currently offline  Leander
Messages: 9
Registered: January 2019
Promising Member
Hello everyone

Cannot upload the others as they are all using 2 packs of my lib, but tried the following with std only:

// main.cpp
#include <iostream> 	// cin, cout
#include <conio.h>	// getch(), _kbhit()
#include <stdlib.h>	// rand()
using namespace std;

int printNumbers()
{
	int num = rand() % 16;
	cout  << (int)num << ", ";
	return num;
}

int main()
{
	for (int i=16; i; i--)
		printNumbers();
	
	cout << "press any key to quit program.";
	return getch(); 
}

And suprise: did the same again.
Will search for another compiler Grin.
Thanx to all for your effort.

Martin
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: FP exception vs NaN
Next Topic: Pre processor and macro error
Goto Forum:
  


Current Time: Sun May 05 01:17:16 CEST 2024

Total time taken to generate the page: 0.02598 seconds