Display students of specific age using struct
#include &lt;cstring&gt;


You're not using any of the features in that header. Replace is with &lt;string&gt; and do use those. Also indent your code, it makes it more readable.

struct student
{
  std::string name;
  int year;
  int group;
};


Don't get into the habit of using this:

using namespace std;


See Why is “using namespace std;” considered bad practice?

int N;
int age;


You only need N a few lines down, and age only way below inside the loop. Declare them as close to their first use as possible, in the smallest scope possible.

cin&gt;&gt;N;
struct student student1[N];


A few issues:


You're not checking whether that read of an int actually worked (same for all the other inputs).
You don't need the struct keyword there. You need it in C where structs live in a separate namespace, but that's not the case in C++.
This is not standard C++: this uses a feature called variable-length arrays which are standard C but not part of C++ (but some compilers have support for it anyway). Instead, use a std::vector (don't forget to #include &lt;vector&gt; also).




return 0;


This isn't necessary, if main doesn't explicitly return anything, the standard guarantees that it will act as if it had returned 0. (This is only valid for the main function, all other non-void functions must return something on all their returning branches.)