The purpose of the following code is to get a random number of 100 nodes and to distribute these nodes randomly in range 500*500 …(X,Y).. this was the first step
#include<iostream>
#include <fstream>
#include<cmath>
using namespace std;
int main()
{
const int x = 0, y = 1;
int nodes[100][2];
ofstream myfile;
myfile.open ("example.txt");
myfile << "Writing this to a file.\n";
for (int i=0; i<100 ;i++)
{
nodes[i][x] = rand() % 501;
nodes[i][y] = rand() % 501;
myfile <<nodes[i][x]<<" "<<nodes[i][y];
}
myfile.close();
}
now the next step is to improve this code to distribute these nodes in order ( "Imust divide both xy_coordinates as : x= 0-100-200-300-400-500 & y=0-100-200-300-400-500) next is to distribute the nodes (regardless number of nodes) in order range Starting from (0,100 )….(100,100)..(100,200)…….untile i reach the last point (500,500),, ")
I’m really confused of how to do it correctly I start to think to define 2 dimensional array , and then to define 2 for loops
enter code here
Int no_nodes=100;
Int XY_coordinate [500][500];
For (int i=0;i<no_nodes; i++)
{
For (int j=0;j<no_nodes; j++)
As shown in the image the x and y axis will be divided in to 5*5 , so I will have 25 grids Starting the axis from 0-99-199-299 until 499 ,what I’m trying to do is to distribute 4 nodes in each “100*100” grid I try to do it by rewrite the code, but I get an error and I could not understand it
THE ERROR IS :" 1 IntelliSense: expression preceding parentheses of apparent call must have (pointer-to-) function type"
how can i fix it ?

#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
int main()
{
ofstream myfile;
myfile.open ("example.txt");
myfile << "Writing this to a file.\n";
int miny=0,max_y=99;
for(int i=0;i<5;i++)
{
int minx=0,max_x=99;
for(int j=0;j<5;j++)
{
for(int k=0;k<=4;k++)
{
int x=(minx+rand()*10(max_x +1)%(max_x - minx+1));
int y=(miny+rand()*10(max_y +1)%(max_y - miny+1));
}
minx=max_x+1;
max_x=max_x+100;
}
miny=max_y+1;
max_y=max_y+100;
}
}