49,756 Topics
| |
First of all, just registered and this forum looks great! PROBLEM: My program which I wrote in Code::Blocks, has compiled fine and has worked fine, but when I run the outputted file called (BINDED.exe) it shows a very quick console window then closes, I think this is due to the … | |
Good Afternoon, How do you write a two nested do-while loops to display the pattern: * ** *** **** ***** ****** So far I have this code, but it just displays ****** int i=0; do{ cout<<'*'; i++; }while(i<5); cout<<endl; | |
Hello all, Im getting the following error when i try to create a simple helloWorld C++ project in eclipse. Please note that i have MinGW, msys and my environment variables set up right. Im using Windows 7 and the 32bit Eclipse Juno. Error: Error 127 occurred while running autoreconf HelloWorld … | |
Hi everyone, I was wondering if anyone could help - I'm trying to split up a char* that contains a string, something like "*Stephen*10:11:00*02/07/2012*Hi there" I'm trying to split it up so it gets the position of the first * then the second, and stores whats between them in name … | |
| How to write a program that will find the smallest, the largest, and sum of squares values in a collection of N numbers? (using loops) |
How di I use I/O redirection to load the input into an array ? % a.out < inputfile That's what I found. I don't know if that's all you need or if there's more.. | |
Hello, I am attempting to write the merge sort algorithm which will generate a vector of 20 random integers and then sort them. The problem is, it does not output the sorted list, it merely outputs a series of zero's and one's. My code is as follows, any help is … | |
Hi, I have some images which I update like below: count++; if(count >= sizeOfArray) { count = 0; } for(u32 i=0; i<sizeOfArray; i++) { s_image[i].image->setVisible(false); s_image[i].reverse->setVisible(false); } I want to know, how do I reverse it. I mean, it is increasing the count and I want to decrease it. The … | |
I'm out of practice on my C++ and have kind of picked up a new hobby; it turns out that I like creating electronic devices. Particularly amplifiers and sound to light kits. Stuff like that; the problem is that determining the amount of resistance a resistor on an old creation … | |
currently I'm rewriting old euler solutions into classes so i can store them in a library. I wrote a program that digitizes a number so it can check to see if it a pallindrome, The base class digitize dynamically allocates memory for the size of a number and stores each … | |
How can I create a Modifiable Const vector but make it unable to be resized? Either that OR I want to return a pointer from a function but not allow the user to delete it. This is my example so far: class MemberRawArrayVector { private: vector<unsigned char> MemberRawArray; public: MemberRawArrayVector(int … | |
Hi! I've encountered another problem, The code below is just the part of the code where the error occurs int FindStr(FILE *f, char *str) { int s_pos; //string position in the text int c_pos; //char position in the text char *string; char ccnt; //char count s_pos = -1; c_pos = … | |
Hello, I'm trying to convert some code from BASIC to C++.. But, I'm stuck on a particular part.. REM CREATE A MATRIX C WITH (COS(DN) , -SIN(DN)) : DIM C(NE, NS, 2) FOR N = 0 TO NE / 2 FOR E = 0 TO NE - 1 DC = … | |
Why does the following code skip the initialization of values of the temporary created? Box::Box() : X1(0), Y1(0), X2(0), Y2(0), W((X2 < 0 ? -X2 : X2) - (X1 < 0 ? -X1 : X1)), H((Y2 < 0 ? -Y2 : Y2) - (Y1 < 0 ? -Y1 : Y1)) … | |
Good Afternoon, I'm having some problems with a problem that deals with raising the power of an integer. So far I have this code. #include <iostream> #include <cmath> using namespace std; int main() { int num, bigNum, power, count; cout << "Enter an integer: "; cin>>num; cout << "What power … | |
Hi, I trying to let the user input how many numbers that they want to average and outputting the average of those numbers. I have this code, but not working as aspected. #include <iostream> using namespace std; int main () { int numCount, total; double average; cout << "How many … | |
I'm a bit confused atm, I don't know when to use const T& or T& or T as a parameter. Currently I'm doing: void Resize(std::vector<T> &Vec, const size_t &NewLength) //Ahh edited the function as a result of Lucaci's answer. { Vec.resize(NewLength); } //But thinking of doing: void Resize(std::vector<T> &Vec, size_t … | |
Hey, Iv been looking around google for the past few days to find ways to embed python 3.2 into my c++ application. I however want interpeter to be compiled into my application, so i can merely distribute one exe file without relying on the user to install python. However the … | |
What does main() function do in?wtz da difference between void main() and int main()?why should I use? extra two questions :- what first two lines, #include <iostream> using namspace std; do? thanks | |
Good Afternoon, I'm having trouble process 2-D arrays to store and process data. I have problems with implementing the void grading function and void showgrades function So far I have this code: Cpp file: #include <iostream> #include <fstream> #include <string> #include <cstring> #include <cmath> #include <cstdlib> #include <iomanip> #include "lab_20_head.h" … | |
I was told you can access the index of an array and save it in a variable. Like, as you know, every element is referenced by an index number. 0,1,2,3,4 etc.. I don't want to save the content, I need the index number. I will need to know the position … | |
I have a file info.txt like below NAME ID=karan PLACE=Mumbai AGE=23- PHONE=1234 HANDICAP=No- OCCUPATION=Student NAME ID=Ravi PLACE=Goa AGE=25- PHONE=4567 HANDICAP=Yes- OCCUPATION=Employee I want to read the file with make them into record strings as below "NAME ID=karan PLACE=Mumbai AGE=23 PHONE=1234 HANDICAP=No OCCUPATION=Student" "NAME ID=Ravi PLACE=Goa AGE=25 PHONE=4567 HANDICAP=Yes OCCUPATION=Employee" Please … | |
**Dudearoo** *Useing Code::Blocks* ok, ive got a somewhat simple error that i cant crack, First heres my code. #include <iostream> #include <cstdlib> #include <stdio.h> #include <time.h> #include <conio.h> #include <stdlib.h> #include <iomanip> #include <windows.h> // so to use strcmp #include <cstring> #include <fstream> using namespace std; int main() { ofstream … | |
I know zilch about electronics, that is why I am on this site, because I have a problem. I do R & D in the world of Metaphysics, and my specialised subject is Subtle Energies. Normally in this field we have to use things like Pendulums, stick pads, muscle testing … | |
The first problem is this: I want to create a LinkedList of type_A. type_A will contain a LinkedList of type_B. The below code fails at compile saying: Node_B does not name a type. The only way i see around this is to create different LinkList.cpp files for each type (such … | |
I'm a little confused about how to go about creating a wrapper class? I think I need to start with the basics. What I want to do is write a C++ wrapper class for a C API. I know several of you could explain this well but I need to … | |
Hello everyone, I have a quick question! I've been program a little heavily lately on my first game in c++ and it got me thinking, how are you supposed to share your game as a closed source project? Thanks in advance! | |
Hi, Im trying to create a script or program that allows me to input data and gives me the result so i can copy and paste in an email. this is what i write on emails the only thing that changes is what is in bold first one is users … | |
I am having some difficulty's locating an issue within some code I am working on. It breaks when it runs the "if (AIwords->name == NULL)" // This is the struct which is located in the header(.h) struct AIstruc_word { char *name; bool controlStatement; struct AIstruc_word *next; }; // This is … | |
# I have Written a code for sine function but it is not much accurate# I have written a code for PI() and sin() function but it is not much accurate I want to make it more accurate can anybody tell how can I make it more accurate. Also I … |
The End.