49,756 Topics
![]() | |
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 … | |
Hi! I´m newbie in C++ Code and JNI, so i have a big problem and i can´t found a solution. My question is: Is possible to call a Jni method in a normal ,method, so: I have in my c++ class, two method: void CVentanasDlg::OnButtonStart(){ printf("OnButtonStart"); } JNIEXPORT void JNICALL … | |
What happens when you set an int or double value to less than the minimum? I need my program to recognize when a number is smaller then the minimum, and then set the value to equal the minimum instead. This behavior is not the default... [CODE]#include <iostream> using namespace std; … | |
I do not know how to compile a visual C++ project using makefile ! I am trying to build a boot loader using C++ and assembly. This is the list if the constituent files in the project: start.asm //this is the beginning bootMain.cpp //main function displayScreen.cpp //clears th screen buffer … | |
hi i want to change the static table to a dynamic table using pointer what should i change in this case ? [CODE] #include <iostream> #include <fstream> #include <string> #include <math.h> using namespace std; int i ,j , l , k ,x ; float b; const int maxElements = 10000; … | |
I was trying to write a program . But when i run it i have this error message this application has requested the runtime to terminate it in an unusual way | |
write a program that can be used to assign and book seats for a commercial cinema. The cinema has 16 rows, with 20 seats in each row. The seats at the mid-column (number 5 to 15) of the last 2 rows closest to the doors (row A and B) are … | |
I was reading a book and i faced an issue here [CODE]39 template< typename NODETYPE > 40 void Tree< NODETYPE >::insertNode( const NODETYPE &value ) 41 { 42 insertNodeHelper( &rootPtr, value ); 43 } // end function insertNode 44 45 // utility function called by insertNode; receives a pointer 46 … |
The End.