General C++ Programming - July 2014 (Page 23)

array of size 10^9 problem
 
question-->http://www.spoj.com/problems/COINS/ My program is working for value of n upto 10^7.Earlier i used an array instead of vector and it was working for n...
[8 replies] Last: @ Disch thanks,map helped me getting the right solution.Vector was tak... (by ankur12106037)
pls help
 
hi I need help. ''C++ basic Program" i want to write a program to read and display the user's name.? the user can type a maximum of 30 characters including ...
[5 replies] Last: Even though you have been given limited functionality due to spamming,... (by BHX)
by m33tz
Static and Namespace
 
When I try to compile program, in which I have additional classes and one header file for globals, I always get an error LNK2005 which says that I have already ...
[2 replies] Last: Thank You!! (by m33tz)
varibles with switch.
 
I am trying to create a basic switch statement that you enter a number ant it tells you the number. but if you enter something other than a integer to does a lo...
[16 replies] Last: nice! that works!! thank you for all the help (by Tyler151)
Sqlite conversion problem
 
When I use the sqlite3_column_blob function it converts my date which is in a LONG format into a string format. It basically converts my time in the database to...
[6 replies] Last: I am just asking if anyone knows how to get it. I could call other fun... (by danielmccarthy)
The last digit problem
 
Question->http://www.spoj.com/problems/LASTDIG/ My solution is not accepted on Spoj because my solution is taking more than 700 bytes. But i m not getting ho...
[3 replies] Last: You need to apply modulo 10 to the power (a^b) mod 10 = ( a^(b/2) * a... (by ne555)
by BasV
const context iterator
 
Hi everyone, I have a data class that I use in 2 ways: To save data, in which case other classes have access and can modify content, and to read data, in whi...
[2 replies] Last: I'll try this, thanks! (by BasV)
Need HELP!! PLZ
 
Hi all, i am creating a program for simple calculation (+,-,*,/) and i need the user to give the 1st number, operator, 2nd number. This is what i did, is this...
[2 replies] Last: In your case statements, you are using double-quotes. These are strin... (by MikeyBoy)
Comparing multiple const char's at once
 
I have an array of const char's that are randomly selected in a loop from a list and id like to compare every newly selected choice to be tested against all the...
[1 reply] : You can do this: -Make a selection -Iterate over the already chosen... (by Mats)
A little help with insertion sort
 
Hello! Could someone please point out the mistake in my code? This is insertion sort and even though i checked the code thoroughly, it does not sort appropriate...
[2 replies] Last: Thank you! I need to pay more attention next time! (by antirsi96)
C++ problem....Please help?!
 
Hi all! I am writing a program. This program is a very small program which finds out the grade someone got. if someone got 0 - 50, they fail. if someone ...
[1 reply] : Hi ShehabKKhan, either add: using namespace std; or use std::cin in... (by InternetSmurf)
Recommendations for iterating over either row or column?
 
Suppose I want to represent an apartment building in terms of floors and rooms with a single data object. Each floor has the same number of rooms at any given t...
[7 replies] Last: > Is there a way, however, to say, "Give Me an iteratable collection ... (by JLBorges)
Help C++ if problem
 
Im doing an IT course and this my first programming scenario (UK) - Every Mile is 50p - Engine size and rate percentage taken away from total expences // ...
[2 replies] Last: line 29 else (help=="N"||help=="n"); should not end with a semicol... (by Chervil)
How do start windows programming?
 
I am rather new to programming (some work in PHP, Jquery, Ruby, HTML, CSS, and now C++). With that said C++ is very different. I have built very basic programs ...
[1 reply] : Look into Qt (http://qt-project.org/). You can Google tutorials for th... (by J4ke)
vector problem
 
I want to make a hacking simulation. The first "mission" requires you to put 3 words in the right order, but when I do put the words in the right order, the gam...
[2 replies] Last: line 43 does not do what you want... it only checks guess3. If you wa... (by Disch)
Complex recursion tracing
 
Hello. Anyone pls explain why I am getting 45 for this when func(12) is called int func(int x){ if(x<5) return 3*x; else return (2*func(x-5)+7); ...
[5 replies] Last: thanks all..I was not getting the return part..I was thinking it like ... (by csstudent123)
Rate of Rise Threshold
 
hi All I'm working on a project that includes a arduino, potentiometer, and a buzzer i need help figuring out how to build the code so when the pot is turned...
[7 replies] Last: You have quite a few misspellings in that code, and it wouldn't run an... (by Yay295)
instance of class A vs class B derived from class A
 
There are two ways to access the members of class A inside class B: 1) Making an instance of class A in class B 2) Deriving class B from class A So what ...
[1 reply] : Public inheritance implies an "is a" relationship. Composition (puttin... (by Disch)
How can I set up two objects to communicate with each other asynchronously?
 
Hello, Here is what I've got so far: // build: // clang++ -g -std=c++11 -Wall main.cpp -o main // main.cpp #include <iostream> #include <thread> #include ...
[4 replies] Last: Thanks a lot! I sure need the reading to understand the code and adapt... (by vincegata)
How to make this function faster?
 
inline long long cryption(long long msg, long long n, int DorE) //Encryption with two keys { long long msgcl = 1; for(int i = 0; i < DorE; ++i) ...
[5 replies] Last: Sweet, I found something someone posted. There is an actual algorithm... (by Idontownaplanet)
July 2014 Pages: 1... 212223242526
  Archived months: [jun2014] [aug2014]

This is an archived page. To post a new message, go to the current page.