49,761 Topics
| |
using c++ program,enter students record and perform the following activity: save search delete view edit print | |
[B]Beginner's Guide to C++0x: The Big Five - Implementing a Resource-holding RAII Class[/B] This tutorial will show how to implement a [I]resource-holding class[/I] showing practical use of [I]C++0x features[/I]. A resource-holding class is any class which holds, with its data members, a resource which could include: [LIST] [*]dynamically allocated memory … | |
Hey guys, I want to know one thing, for instance I am having a character array like this: [@@123124123123125@@@] where 123, 124 and 125 are one three-digit numbers and are NOT separate like 1,2 and 3. I want to know the number of times 123, 124 and 125 have occurred. … | |
hi, i am just wondering how to open a picture of a normal format. I know that you cant do it in the console. And i am using the compiler DEV-C++. Thanks | |
Not sure why this moderator or admin or whatever deleted my previous thread because it wasn't anything malicious.. My problem is that getfileattribute doesn't work for me.. and my code below is just a snippet of my entire program which is below that.. Dear Mod: I think you deleted it … | |
Hi All, I have a simple question, I hope. Here's the overview of the problem: "There is a board game with 9 squares on it (three rows of 3 squares). Each square has a coin on it. The coins can be either heads or tails side up. You can only … | |
Well, I define a function gotoxy(). [CODE]void gotoxy(int x, int y) //定位到第y行的第x列 { HANDLE hOutput; COORD loc; loc.X = x; loc.Y=y; hOutput = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleCursorPosition(hOutput, loc); return; }[/CODE] However,whenever I use it.There is a flashing cursor which is ugly to see. I want to get rid of it.But I don't … | |
A couple questions I have for anyone that knows WINAPI as Im trying to learn it right now.. I usually program in .Net Managed and the basic console stuff. [B]First:[/B] Is there a designer for WinAPI like there is in Visual Studio Form App Editor? Or is it just outright … | |
What is the easiest way to check if a vector is empty? [CODE]#include <iostream> #include <vector> using namespace std; typedef std::vector<double> Vec; typedef std::vector<Vec> Mat; int main(){ Vec v; // this is what i consider to be an "empty" v if( /*check if v is empty here*/ ) cout<< "v … | |
hi guys i am planning to create a website for my school(i am a high school student) that saves the students marks and then gives too many out puts. i am doing it for the science fair after 2 months. that is not my problem, my problem is i need … | |
Hi, we have this school activity that is rush for tonight. I would really appreciate if somebody will help me. It would really mean a lot to me. So here is the problem that were tasked to us to create a C++ program. Problem: Write a C++ program to perform … | |
Hello! I am making a program which does many computations for a Photovoltaic system. The problem is that i get a strange segmentation fault error when I run the program. Here is where it crushes (at for-loop of calculation S5) : [CODE] commands..... ... ... /******************** WIRING *******************************/ Ni = … | |
hello i just have started learning c++ but i have a big problem at sources .. i want to make something is unsigned then i have to change it from int3t_t to unit64_t but when i change it at player.h it says it must be changed at creature.cpp and alot … | |
Hello. I am trying to write a program where a human can play rock, paper, scissors with the computer. I'm stuck on the "determine computers choice" part......Here's my code so far... [code=cpp] #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main () { // initialize the computer's random … | |
this is a piece of my header file that is a template and my implementtion file that is using it.I keep getting errors and dont know why,any help would be appreciated. [CODE]template<class T> class List { public: private: T *list; int size; int numElements; bool isValid(int location) const; }; [/CODE] … | |
Hi there, I need to read a file with unknown number of columns and lines. Basically, I have an ID per line (ID00005) and many columns containing 2 letters. The format is: ID00005 RR WW SS QQ TT RR UU II ID00008 WW SS QQ YY HH JJ KK LL … | |
I recently started visual studio 2010.After searching in google I was able to create a .cpp program. everything is fine; I can build it and run it without getting errors.But everywhere in the internet I see when they run the program they can see a black command prompt window which … | |
This function is returning the error "matrixOpsLibrary.h:11: error: invalid initialization of reference of type ‘const std::Vec&’ from expression of type ‘const double’" [CODE]#include <vector> #include <cmath> using namespace std; typedef std::vector<double> Vec; //Vector Vec floor( const Vec& y ){ unsigned n = y.size(); Vec bottom(n); for( unsigned e=0; e<n; ++e … | |
I was wondering if there is a library or smt that can allow a programmer to use other foreign languages in C++. For instance i want my c++ program to display some Greek messages that i will define, but instead i get some garbage. Is there anyway to call unicodes … | |
Hi, How do I correctly call a function which expect BSTR* as a parameter? eg: [CODE]void FunctionA(BSTR* b) { // Do something }[/CODE] Currently, my code is as follow: [CODE]void Caller() { BSTR* pbstr; FunctionA(pbstr); }[/CODE] However, during compilation, I get warning "local variable pbstr' used without having been initialized". … | |
hi i compile this code but it works but i have as result the error message "Memory is insufficient! " [CODE] #include <iostream> #include <iomanip> #include <fstream> #include <string> #include <math.h> #include <nurbsS.h> #include <nurbsSub.h> using namespace std; int i ,j , l , k ,x,y ; float b; const … | |
I wrote the following code to create a wav file which generates varying frequencies based on the Hebrew Gematria pattern. It compiles great but does not write the wav file. What am I not understanding about this code? [CODE] #include <iostream> #include <math.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include … | |
Hi All, When my code tries to free the memory allocated by the new operator it throws a debug error while using the delete operator... [CODE] CDocum* pDocum = new CDocum(); int nResult = pDocum -> QuoteDocProd(); delete pDocum; [/CODE] Error Am getting is Debug Error! Damage after Normal Block(#298753) … | |
Hi! I try to compile this code [CODE] while( file >> word) { word.size(); T[i]= new string[word.size()]; *(T[i])= word; i=i+1; } for (j=0;j<i;j++) { Bt[j] = new float [100]; *Bt[j] = *atof(*(T[j]).c_str()); } [/CODE] but i have this problem [CODE] error C2228: left of '.c_str' must have class/struct/union [/CODE] where … | |
hi, am a novice in programming. i am facing some difficulty in C++ programming, actually i want to read a column of numbers from a text file or an excel sheet and store that in an array so that i can use it for further processing.Plz help me to solve … | |
pls give me a hint or any idea on how i can solve my problem..tnx.. | |
Code 1: [code]#include<iostream> using namespace std; int& func() { int a=6; return a; } int main(void) { int a = func(); cout<<a; cin.get(); return 0; } [/code] According to my thought , first of all func() will create a temporary reference to a (as it is returning by reference) , … | |
Hello everyone, I have a small question about the code below, I understand just about every part of it. Except for this small snippet, could someone explain how the loop works? [CODE] while(begin != end ) //<-- I believe the stream iterator is getting input here words[*begin++]++; // <-- I … | |
I keep getting errors and i dont know what im doing wrong.I've included just pieces of these three files. The compiler is giving me errors and i dont know what's wrong. this is my header file List.h not all but some of it. [CODE]#include <iostream> using namespace std; #ifndef INTEGERLIST_H … | |
Hi, I'm stuck... I'm writing a program that creates a data file then populates the file with 500 random integers both positive and negative. The problem I'm having is reading the integers from the file and storing them into three arrays for processing neg[],posEven[],and posOdd[]. I really just need a … |
The End.