49,757 Topics
| |
heeey guys i want to make predator and pray simulation and i made the 2d array i just don't know what to do next i need help !!!!:S [CODE]#include <iostream> using namespace std; void printGrid(char grid[][20], int w, int h); int main() { // Create a 20 by 20 grid … | |
I wanted to have a vector<string> and a vector<double> in my class so I used forward declarations below: [CODE=c++] class string; template <typename T> class vector; [/CODE] But I recieve the error: [ICODE]field 'varname' has incomplete type[/ICODE] for both vector<string> and vector<double> variables. I searched internet for this error but … | |
Hey guys I have a program im doing for fun, I need to be able to enter a minimum exponent and a maximum exponent as well as a base. CANNOT USE THE POW() FUNCTION. Ex. minimum exponent = -2 maximum exponent = 3 base = 2 output: base exponent result … | |
Good Afternoon, I am working on a project in which I would need to create a matrix of nxm dimensions, in which the top, bottom, left and right edges should have the value 1 and the interior of the matrix should be a random between 0 and 1 with a … | |
Code::Blocks isn't working. I recently reinstalled to get a newer version and when I hit build I get the following error: [CODE]mingw32-g++.exe -Wall -g -I"C:\Program Files\CodeBlocks\MinGW\include" -c D:\Programming\C++\TESTINGOPENGL\main.cpp -o obj\Debug\main.o Execution of 'mingw32-g++.exe -Wall -g -I"C:\Program Files\CodeBlocks\MinGW\include" -c D:\Programming\C++\TESTINGOPENGL\main.cpp -o obj\Debug\main.o' in 'D:\Programming\C++\TESTINGOPENGL' failed.[/CODE] Please help! | |
I'm getting a runtime error, and I can't figure out why. I'm developing the insert method of a btree. Below is the code of insert() [CODE] void insertar(btree* r, int dato){ int pos=0; btree* encontrado= buscar(&*r, dato, 0); //buscar() searches if [COLOR="Red"]dato[/COLOR] already exists if (encontrado==NULL) printf(" data already exists"); … | |
Hello everybody. Just a query (in fact two) I have a reasonably huge matrix type data which is to be used via some other calculations, In the matrix are values of 1s, 0s and -1s which will appear in random and the actual i-jth position is important. Is it any … | |
[CODE]#include "stdafx.h" #include<iostream> using namespace std; class A { public: A(){} void setdata(int s) {t=s;} int getdata(){return t;} protected: int t; }; class B: public A { public: B(){} }; void main() { A a; a.setdata(3); B b; cout<<b.getdata(); }[/CODE] Why I cannot get an output of 3 here? Can … | |
Hi, in my code the class CFactory has a non-type template parameter TStaticMemberFct which is a static function of a different class that should get called when Wrapper() is called via a CInterruptDelegate object. But it seems that Wrapper() gets already called when it is passed as the CInterruptDelegate constructor … | |
Hi, Why is it that when I remove(commented out) the inner j for loop and all it's contents, the cmd prints out my desired output. However, replacing back the inner for loop, it gives an incorrect output -> my counter values are wrong when printed. Can anyone spot what I … | |
Hello All Recently I go through the concept of virtual function in C++. I have confusion with how many vitual pointer and virtual table for a single class are created? And if the class is inheriing some other then what will be the situation? | |
Ok, in a very simplified version ive got to write a C++ app to interface with a joystick and play various sounds depending on its position - Its a USB joystick and I will have a QT GUI. This app already exists, for Windows/C# . I just need help porting … | |
Hi I have never come across such code before. I can't make out what it is [CODE]SockerManager::SocketManager() : sockets(0), events(0), nSockets(0) {}[/CODE] Could someone tell me what does something like a() : b() mean? Thanks Devesh | |
Hi, I have just started learning classes and I have to make a matrix class. I know matrix math so that is not an issue, basically I have an h and cpp with function names and parameters and just have to define them. My problem is that Im stuck at … | |
Hello Everyone! So I have an assignment to create a program to read in data from text file. I managed to get that part, but I'm having trouble with two areas. 1. Having the names read from the display read into a 10x3 format (10 rows, 3 colums/seats.) Expected output: … | |
I have a Plain Text matrix file (called q.txt): [CODE]1 0 0 0 2 0 0 1 1 0 0 1 1 1 1[/CODE] which I would like to read into a matrix, which is a vector containing vectors (which contain doubles). My current codes yields the error "newReader.cpp:22: error: … | |
[code] #include <stdio.h> #if 1 //! Set Pin string const char* const ONCLI_SET_PIN_CMD_STR = "set pin"; #endif const char* const SINGLE_APP_STRINGS[] = { ONCLI_SET_PIN_CMD_STR }; int main() { printf("%s\n", SINGLE_APP_STRINGS[0]); getchar(); // pause return 0; } [/code] Line 12 Error message... [code=text] 12|error: initializer element is not constant 12|error: (near … | |
hello, I'm currently writing a program to write a website easier, but i don't know, how output " to a file? thank you very much for help | |
Is there a more efficient way to do this? [CODE] vector<int> myvec; vector<int>::iterator it; /////// // Count # of iterations int i = 0; while ( it != myvec.end() ) { ++it; ++i; } [/CODE] Just seems expensive to me. | |
hi all, I have this minor problem which is making me go cranky at the mo.. Can't think straight, need some insights to what I can do... Below is the code which I am working on which takes the test sample values stored in my test 2D array subtracts the … | |
OK, so I already program is C#, but I am taking a C++ class. I want to create a windows forms application and have other classmates create some classes that we can all put into the windows forms application to create a final project. Well the entire book only takes … | |
Hi I have a problem with some code. Basically what the program is supposed to do is to take in a minimum exponent and a maximum exponent and a base. Then its is suppose to create a table displaying the base to the power of the minimum exponent to the … | |
hello , I need to add this include: #<graphic.h> to dev c++ | |
| Hi I have a problem with a code I made, some save editor for some game. The code suppose to write 2 bytes to a specific offset in some file. The file's short integers are saved as little endian. everything works fine, but when one of the integers equal 10, … |
Hey everyone! Well I'm sooo close to getting the names to align BUT there is 1 slot that is skipped in the non-smoking section and a few in the smoking section and i can't figure out why. The Data needs to be displayed in a 10 row x 3 column … | |
I have a class that looks like this [CODE] //the mem_data class======================================// class mem_data { public: mem_data(int,int,std::string); ~mem_data(); private: std::vector<reader> mem_store; int complete; friend class model_base; }; [/CODE] Now, I would like to let the class model_base access mem_store My main code will contain the following: [CODE] mem_data test_data(20110601,10,"test_file.csv"); model_base … | |
this is my project its hard who can write it for me please Write a C++ program to read, save, sort, search and display the students’ ids, student names and marks of N students.fficeffice" />>> N=7 should be declared as a constant in your program. You must use arrays to … | |
Please tell me how bad this code segment is. I figured I would share this horrible code. If it's not as horrible as I think it is, please let me know. Thanks! [CODE] /* Purpose: Create a function to check the input from user. Only valid integer should be returned. … | |
Hi. I'm trying to make a simple question program, my first question doesn't work (if you enter the wrong answer/an answer that isn't an integer, you get stuck in an infinite loop). However, my second question works fine even though the code is quite similar. Sorry if I'm being a … |
The End.