49,761 Topics
| |
I want a fast algorithm to calculate no of permutations for n elements with some elements identical. Using formula : n! / k1! k2!....km! where ki = no of i elements, i = (1,2,...m) and k1 + k2 + ...... + km = n **Without calculating each factorial** as if … | |
Hi, I only know C++ as a medium level programmer, not a real beginner but absolutely no veteran, I need to learn so much more C++ stuff. I can fairly program small programs in C++ and i really like C++. I also started using some of the new cool C++11 … | |
I need to extract pitch, dynamics (loudness or softness), tone color, and duration of an audio file. This is regarding some research work I am doing. How should I start ? Provide me with some links if possible! Is C++ a good option for this? Or should I try some … | |
Here's my code in which i am getting SIGABRT for 7 test cases :- #include<cstdio> #include <queue> #include <vector> using namespace std; int main() { //variable declarations int i,j,steps=1,n,m,s,t,tmp,tmp1,visited[1000001]; vector<vector<int> > buildings ( 3501, vector<int> ( 3501 ) ); queue<int> tovisit; //take inputs scanf("%d %d",&n,&m); for (i=1;i<=m;i++) { scanf("%d %d",&tmp,&tmp1); … | |
i'm using Dev-cpp. i tried my best to find out the reason but could not so please help me out | |
Hello everyone ! I want to get output in C++ in same line. The following code gives me output in separate line. for(int i=0; i<=10; i++) { cout << i <<" " <<endl; } | |
am having a problem in incrementing the number automically into the database every the when save. The initial number i want it to be 001 in a text box and when i save it, it should increment into 002 and so on. And every time i load the web page … | |
This is probably a silly question but i really don't know the answer to it. Can you write a program in C++ and have another part written in C and compile them into a single executable file? I'm thinking a c/c++ compiler like visual c++ would do this.. Is that … | |
Can anyone check my memory class and suggest changes or things I may need? I'm writing it so that I don't have to worry about deleting anything everytime I allocate. #include <iostream> template<typename T> class Memory { private: size_t size; T* data; public: explicit Memory(size_t Size) : size(Size), data(new T[Size]){} … | |
Good Afternoon, This is my first class in C++ and I'm having problems with a program that needs to print a calendar of June, July and August 2008 into the output file "outCalendar.txt" . I should format the result for month well so that it looks like a real calendar … | |
This program does not crash but behaves badly due to not allocating enough space for vector z in line 21. If I comment out line 21 and instead uncomment line 23, things work well. If I comment out both lines 21 and 23, the program will crash, presumably because I … | |
What's a fast way to fill a union/struct of integral members with ALL Zeroes? RECORD* UNION = {0}; void ZeroStruct(int X, int Y) { UNION = new RECORD[X * Y]; int K = 0; for (int I = 0; I < X; I++) for (int J = 0; J < … | |
Is it possible to overload one operator more than once? I have a struct that is just my idea of a C++ Box. I'm trying to increase the size of a box using an integer or another box. I'm trying to do: Box X(0, 0, 0, 0); Box Y(1, 1, … | |
I am currently working on kind of multi-graph structure. The thing is that two graphs are needed for my application which span the same vertices but with two distinct set of edges (i.e., a multi-graph). The first graph is a binary search tree, while the second graph must be general … | |
Hey, I am trying to make a C++ scrit that decodes and encodes tenis polar (search it on Google if you don't know what it is). After some testing, I found out my application stops after the strcpy. Any help? The code is below. Thanks! #include <iostream> #include <cstring> #include … | |
Hey all, I usuallly don't like asking for help on these sites but I have been kicking myself for a while now implementing boost regex for a program (i have never had any prior issues). I believe the issue is with my regex syntax but i have tried numerous variations … | |
I have a union defined as so: typedef union RGB { unsigned Color; struct { unsigned char B, G, R, A; }; } *PRGB; I'm reading 32 bit and 24 bit bitmaps. I'm trying to Read Pixels from my RGB union and set pixels as well. I know bitmaps are … | |
The following is my code for Edit Distance problem. The problem asks us to find the edit distance between two strings. My code, I think gives the correct output. If I run the code with two strings of 1500 length each, I get the error. But if I run it … | |
I have a problem. 1>------ Build started: Project: SDL Test, Configuration: Debug Win32 ------ 1> playa.cpp 1> main.cpp 1> Generating Code... 1>c:\users\will\documents\visual studio 2010\projects\sdl test\sdl test\main.cpp(43): warning C4715: 'load_image' : not all control paths return a value 1>c:\users\will\documents\visual studio 2010\projects\sdl test\sdl test\main.cpp(43): warning C4715: 'load_image' : not all control paths … | |
So I was trying out SDL_gfx lib and tryed using the rotozoomSurface() [Click Here](http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__rotozoom_8h.html#a3cb0c11d5edc929579c807dc7612348c) which should've rotated my surface at runtime, but it seems that whenever I do that my surface turns invisible. It doesn't matter if I predefine the rotation or use it at runtime, the same happens, I've … | |
I'm very new to C++; can a program be started with anything other than `int main`? And what, exactly, is the purpose of the `main` part, anyway? | |
| #include "stdafx.h" #include <iostream> using namespace std; int main () { int a, b, c; cout << "š"; cin >> a; cout << "Č"; cin >> b; c = a+ b; cout << "Ć" << c << endl; return 0; } So i tried using characters from my own language … |
hello everyone..i've vs2010 in my system..and i'm trying to build a simple web browser using webkit..could anyone please tell me what do i need to install to be able to work on vs2010?? and a simple demo code about how to use the webkit sdk..i've searched a lot on google..but … | |
I'm using VC++ 2010 with Windows 7 x64. I'm compiling all my code as C code. I have a for loop like this: for (i = 0; i < max; i++) { ... } But when I run it, `i` is being set to `max` If I set `i` to … | |
#include <iostream> #include <cmath> #include <iomanip> using namespace std; int main() { float annualIntRate, principle, monthlyPayment, monthlyIntRate, totalAmt, intPaid; int yearsBorrowed, numPayments; cout << "This program computes information associated with a loan" << endl; cout << "Please input the Annual Interest Rate:" << endl; cin >> annualIntRate; cout << "Pleast … | |
Dr Mirna always gives True/False tests to her class. Her tests have always 10 questions. The maximum class size is 5. She needs a program that will calculate the students’ grades based on the best grade. Grade A will range from the best score, to the best score minus 2. … | |
So i wanted to write a Hangman game and i started it, as im newbie programmer it took me several days to track all the bugs etc. Meanwhile i want to get good habits on designing and i read that Getters and Setters arent the best way to go for … | |
Hi -i've started using netbeans and compiling in it recently and I'm not sure what the problem is here. Not sure if it isn't reading the Element.cpp/.h files while building/running the main.cpp In my main: Element a, b(5); cout<<(5+b)<< endl; Then in the .h: Element operator+(const Element&obj); And in the … | |
I am new to programming and am having REAL trouble trying to output Pascal's Triangle (formatted into a triagle) using multidimensional arrays. I would really appreciate some help. In the program, the user is supposed to input the # of rows desired (up to 15... or else it won't fit … | |
I found a lot of books introduce about objective C but can't find a book which talk about objective C++.Could you introduce me an objective C++ textbook? I learned C++ before but don't know objective C, where should I start if I want to learn objective C++?Looks like it is … |
The End.