Why i having this error using opengl C++
here part of code
#include "glaux.h"
#include "glut.h"
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <time.h>
some coder here and etc
bool isGood(Tpos a)
{
DataToCp();
int k=0,i,j,lt;
Tpos temp;
cp[a.y][a.x]='x';
if
((step(a.y,a.x)>3)||(step(a.y+1,a.x)>3)||(step(a.y-1,a.x)>3)||(step(a.y,a.x+1)>3)||(step(a.y,a.x-1)>3))
return false;
for(j=1;j<=m;j++)
for(i=1;i<=m;i++)
if (cp[j][i]=='.')
{
if (k>0)
return false;
fill(j,i,&temp,<);
k++;
}
return true;
}
void genMap()
{
int i,j;
map.x=m+2; map.z=m+2;
printf("Loading...\n");
srand( (unsigned)time( NULL ) );
for (j=0;j<map.z;j++)
for (i=0;i<map.x;i++)
{
if ((i==0)||(j==0)||(i==map.x-1)||(j==map.z-1))
data[j][i]='x';
else
data[j][i]='.';
}
int k=0;
Tpos t;
while (k<(int)m*m/2.5)
{
t.x = rand()%mm+1;
t.y = rand()%mm+1;
if ((data[t.y][t.x]=='.')&&(isGood(t)))
{
data[t.y][t.x]='x';
k++;
}
}
for (j=1;j<=m;j++)
for (i=1;i<=m;i++)
if ((data[j][i]=='x')&&(step(j,i)>3))
{
data[j][i]='.';
}
for (j=1;j<=m;j++)
for (i=1;i<=m;i++)
if ((data[j][i]=='.')&&(step(j,i)<2))
{
t.x = i; t.y=j;
if (isGood(t))
data[j][i]='x';
}
Tpos ps[11]; k=0;
while (k<=10)
{
t.x = rand()%mm+1;
t.y = rand()%mm+1;
if (data[t.y][t.x]=='.')
{
ps[k]=t;
k++;
}
}
k=rand()%11;
player.x=ps[k].x;
player.z=ps[k].y;
DataToCp();
fill(ps[k].y,ps[k].x,&t,&pathLen);
ex.x=t.x;
ex.z=t.y;
printf("Loading Completed. \n");
}
it seems the problem is in the
#include "glaux.h"
#include "glut.h"
pl. check these files. Maximum errors are related to the reference to various methods.
Why i having this error using opengl C++ here part of code #include "glaux.h" #include "glut.h"...
C Programming - RSA Encryption I've tried to write a program that can encrypt and decrypt strings using RSA and want to be able to integrate it into a header file which contains codes for compression, linked list etc.. However, the use of global variables and fixed size of encryption is making it hard to do so Can someone please help me modify the following the code? I want to be able to just pass it in a string to...
How can I integrate these programs into this menu template: #define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include void program_one (); void program_two (); void program_three (); void program_four(); void program_five(); int main() { int menu_option = 0; while (menu_option != 9) { printf(" = 1\n"); //Change this to your first program name. Nothing else. printf(" = 2\n"); //Change this to your second program name. Nothing else. printf(" = 3\n"); //Change this to your third program name. Nothing else. printf(" =...
Write a complete C program. Define a structure type element_t to represent one element from the periodictable of elements. Components should include the atomic number (aninteger); the name, chemical symbol, and class (strings); a numeric field forthe atomic weight; and a seven-element array of integers for the number ofelectrons in each shell. The following are the components of an element_t structure for sodium.11 Sodium Na alkali_metal 22.9898 2 8 1 0 0 0 0 Have the user enter the data...
C Programming - RSA Encryption I've tried to write a program that can encrypt and decrypt strings using RSA and want to be able to integrate it into a header file which contains codes for compression, linked list etc.. However, the use of global variables and fixed size of encryption is making it hard to do so Can someone please help me modify the following the code? I want to be able to just pass it in a string to...
Using C, I need help debugging this program. I have a few error messages that I'm not sure how to fix. Here is the code I have: /* * C Program to Print a Linked List in Reverse Order */ #include <stdio.h> #include <stdlib.h> struct node { int num; struct node *next; }; int main() { struct node *p = NULL; struct node_occur *head = NULL; int n; printf("Enter data into the list\n"); create(&p); printf("Displaying the nodes in the list:\n");...
C++ how can I fix these errors this is my code main.cpp #include "SpecialArray.h" #include <iostream> #include <fstream> #include <string> using namespace std; int measureElementsPerLine(ifstream& inFile) { // Add your code here. string line; getline(inFile, line); int sp = 0; for (int i = 0; i < line.size(); i++) { if (line[i] == ' ') sp++; } sp++; return sp; } int measureLines(ifstream& inFile) { // Add your code here. string line; int n = 0; while (!inFile.eof()) { getline(inFile,...
How would I be able to get a Merge Sort to run in this code? MY CODE: #include <iostream> #include <fstream> #include <stdlib.h> #include <stdio.h> #include <time.h> using namespace std; class mergersorter { private: float array[1000] ; int n = 1000; int i=0; public: void fillArray() { for(i=1;i<=n;i++) { array[i-1]= ( rand() % ( 1000) )+1; } } void arrayout () { ...
Please explain how these code run for each line #include<stdio.h> #include<string.h> /** * Part A */ struct myWord{ char Word[21]; int Length; }; int tokenizeLine(char line[], struct myWord wordList[]); void printList(struct myWord wordList[], int size); void sortList(struct myWord wordList[], int size); /** * main function */ int main() { struct myWord wordList[20]; char line[100]; printf("Enter an English Sentence:\n"); gets(line); int size = tokenizeLine(line, wordList); printf("\n"); printf("Unsorted word list.\n"); printList(wordList, size);...
Hello, I want to check if my C++ code is correct and follows the requeriments described thanks. Requeriments: Assignment Sorting Benchmark each of the sorting methods listed below. Insertion Sort Bubble Sort Selection Sort Heap Sort. Quick Sort. Merge Sort. Benchmark each of the above sorting methods for data sizes of 10000, 20000, 30000, 40000 and 50000. Display the results in a table as shown below. The table should have rows and columns. However, the rows and columns need not...
Merge Sort: Time Complexity: O(n log(n)) #include "stdafx.h" #include <iostream> #include <time.h> #include <stdlib.h> using namespace std; void combine(int *a, int low, int high, int mid) { int i, j, k, c[100000]; i = low; k = low; j = mid + 1; while (i <= mid && j <= high) { if (a[i] < a[j]) { c[k] = a[i]; k++; i++; } else { ...