49,761 Topics

Member Avatar for
Member Avatar for Taniya19

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 …

Member Avatar for TrustyTony
0
166
Member Avatar for sternone

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 …

Member Avatar for sternone
0
244
Member Avatar for apanimesh061

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 …

Member Avatar for mrnutty
0
81
Member Avatar for Fazura

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); …

0
111
Member Avatar for Nikita Sachdev
Member Avatar for jaskij
0
191
Member Avatar for new_developer

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; }

Member Avatar for new_developer
0
1K
Member Avatar for kuki123

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 …

Member Avatar for Schol-R-LEA
0
181
Member Avatar for daino

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 …

Member Avatar for rubberman
0
260
Member Avatar for triumphost

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]){} …

Member Avatar for rubberman
0
137
Member Avatar for poloblue

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 …

Member Avatar for Schol-R-LEA
0
397
Member Avatar for VernonDozier

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 …

Member Avatar for VernonDozier
0
383
Member Avatar for triumphost

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 < …

Member Avatar for mike_2000_17
0
268
Member Avatar for triumphost

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, …

Member Avatar for triumphost
0
2K
Member Avatar for mike_2000_17

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 …

Member Avatar for mike_2000_17
0
674
Member Avatar for funkey100

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 …

Member Avatar for Schol-R-LEA
0
310
Member Avatar for missil9

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 …

Member Avatar for missil9
0
315
Member Avatar for triumphost

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 …

Member Avatar for triumphost
1
443
Member Avatar for Nikhar

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 …

Member Avatar for Nikhar
0
327
Member Avatar for Albino

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 …

Member Avatar for Albino
0
464
Member Avatar for nuclear

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 …

Member Avatar for nuclear
0
232
Member Avatar for Patiodude

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?

Member Avatar for VernonDozier
0
185
Member Avatar for Jackk123

#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 …

Member Avatar for Jackk123
0
883
Member Avatar for cool_zephyr

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 …

Member Avatar for cool_zephyr
0
502
Member Avatar for tomtetlaw

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 …

Member Avatar for DeanMSands3
0
147
Member Avatar for tensity

#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 …

Member Avatar for tensity
0
125
Member Avatar for tubzz

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. …

Member Avatar for deceptikon
0
669
Member Avatar for coffecat

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 …

Member Avatar for Schol-R-LEA
0
318
Member Avatar for phfilly

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 …

Member Avatar for rubberman
0
165
Member Avatar for lostinthespiral

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 …

Member Avatar for deceptikon
0
829
Member Avatar for stereomatching

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 …

Member Avatar for stereomatching
0
418

The End.