General C++ Programming - September 2014 (Page 6)

What is the complexity of my vowel_remove in string? Is there any faster way?
 
This is a simple code that removes vowel. What is the complexity of my code (Big-O) and is there a better way to do it? Thanks int main() { // char *text...
[1 reply] : What is the complexity of my code (Big-O) Linear: O(n) there a bet... (by MiiNiPaa)
by docawk
1e9 vs 1e-9
 
In the context of rounding to the ninth digit, I found operating with values 1e9 or 1e-9 to return different results: double x=500.00000000000006; x=floo...
[6 replies] Last: For completeness: double cc=1/1e-9; // cc 999999999.99999988 ... (by docawk)
Compound interest formula coding
 
Im having problems coding this A = P(1 + r/n)nt //Declared test cases float principal = 200000.00, annualInt = 0.03; float years = 10.0; fl...
[1 reply] : You don't need A = ... again when calculating the interest. ... (by liuyang)
by Chubby
Counting the word
 
I dont know if this a right place to ask but anyway here you go: I am trying count all occurrences word are that are in the file but i dont know how to do it...
[15 replies] Last: First of all, write a short function to read whole content of a file ... (by liuyang)
Help Converting Base to Base
 
'm trying to convert any number system up to base 16 to another base system. Both bases are given by the user as well as target number. Im trying to get my outp...
[2 replies] Last: 1. This stuff isn't doing what you think. if(std =a||A) std =1... (by kbw)
Vector help: Multiple bullets acting as one
 
I'm trying to make a 2d shooter with SDL and I got as far as having multiple bullets but they act as one when a bullet goes off screen. I shoot 1st bullet, then...
[1 reply] : Try not erase items in a vector in 'for' loop. (by liuyang)
std::function as class member?
 
Is it possible to use a functor like std::function<T* (Args&& ... args)> as class member? I've seen many examples using type erasure for the return value of the...
[9 replies] Last: Thanks for the great explanation! I think I got it now and see I've to... (by hellhound)
access violation?????
 
# include <iostream> # include "graph1.h" using namespace std; void getData(int* no_rects); int* getXCoords(int no_rects); int* getYCoords(int no_re...
[1 reply] : try this int** getXCoords(int no_rects); int** getYCoords(int no_rect... (by novellof)
cout << &var; to binary??
 
How can I output the address of a variable in binary? #include <iostream> #include <sstream> #include <string> using namespace std; int main() { int x =...
[2 replies] Last: SOLUTION IS HERE http://www.cplusplus.com/forum/beginner/143174/... (by novellof)
Want to create a game (correctly).
 
I'm learning C++ on my own and taking a class at my university for C. I want to create one of two games, a smaller version of "RuneScape Classic" or my own vari...
[3 replies] Last: The problem with starting on either of those two projects are you'll w... (by Krisando)
How to find Min,Max, and Avg without arrays in program.
 
This program does everything i want except for one major problem and one small one. 1. The program keeps taking my last entered number and counting it as max a...
[1 reply] : Hi, One immediate thing I can see: Get rid of line 2 - std::count ... (by TheIdeasMan)
by rezora
Invoke a template function?
 
Hello, I wrote out this coding to deal with template functions, but how would I invoke the function and to display the statements which im trying to invoke? ...
[2 replies] Last: I'm sorry for not being clear haha but I was also being stupid ive man... (by rezora)
Help with using a class in C++
 
Hello, I"m new here and trying to do well in a class I am taking. I just finished writing code for an assignment I have due and am looking for guidance. The ass...
[5 replies] Last: By denormal's "last comment", do you mean his last paragraph? I think ... (by TwilightSpectre)
by sebz92
doubly linked list - delete function HELP!
 
Hello! i am creating a doubly linked list that will store strings, for example: one two three four five six seven and i want to delete one of the wo...
[3 replies] Last: As long as you make a new function for that. (by helios)
C++ Submenu help
 
I fixed it and now I have a new question. My second issue is that all the functions except the add function need to be a submenu. I can't find an example onl...
[2 replies] Last: Let's start with your Add() function. First you need to be sure the fi... (by jlb)
Help with Error
 
So I am working on an assignment and it works for the most part but at the end I get an error message that says Heap corruption detected after normal block (#13...
[2 replies] Last: Lines 8 and 17: You allocate bufferSize characters. Lines 9 and 18... (by AbstractionAnon)
How would you go about creating an exact age calculator (1,2,3,4)
 
I've been wondering this, since there is so many things which needs to be taken care of. I created one, but it wasn't precise.
[63 replies] Last: Still need help. (by Slashdash)
Help with redesign, please.
 
Using the proxy pattern was JLBorges' recommendation for a specific need in my program, and it has been working beautifully until the following scenario is reac...
[12 replies] Last: > Which design is better? I do not have a complete understanding of t... (by JLBorges)
by vidos
dynamic array
 
i am having trouble with this im not sure what to do. this project is past due so i get no credit for it but i still want to know how it works here are the pa...
[no replies]
by judo11
My program won't run in Dev C++.
 
This program runs very well in Visual C++ and I also want to run this program in Dev C++. How can I run this program using DEV C++? #include<iostream> #inc...
[5 replies] Last: Another option, since the compiler you're using may not support C++11,... (by jlb)
September 2014 Pages: 1... 45678... 28
  Archived months: [aug2014] [oct2014]

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