General C++ Programming - September 2016 (Page 2)

Code::Blocks Indentation Issue
 
Hi guys I use the Code::Blocks IDE for C++ programming. I am pretty new to Code::Blocks but like it a lot. Except that when I use for statements it does ...
[4 replies] Last: @coder777 Yes, but even if I change those settings won't I have to pr... (by boost lexical cast)
Issues with array and the output it displays
 
hi, I'm having trouble getting the output I'm trying to get. i don't know if the issues are in the if statements or how i declared the variables. My code looks ...
[1 reply] : You have a } in the wrong place. The } at line 93 should be after li... (by AbstractionAnon)
data of file into array/ and calculate data
 
hello everyone, I'm a bit stuck right now. i don't know exactly how to start , store and calculate the data from a file. this is what i have right now: i...
[3 replies] Last: If you process one record at a time from the file, you only need an ar... (by AbstractionAnon)
C++ How to write generic comparator function for int, double, string etc using templates
 
Hi I am trying to write a generic isLess compare function for int, double, null terminated character array etc. Below is my code for same, please help me unders...
[11 replies] Last: Thanks @JLBorges for such nice detailed explanation :) (by kapil2905)
Using 'range for' for multidimensional arrays does not work
 
Hi, I have the following code: int native_array ; int cnt = 1; for( auto x : native_array) { // TYPE OF x is int (*) ...
[8 replies] Last: BTW, jlb, why are you taking the address of native_array in your size... (by jlb)
**How to evaluate a prefix expression with Stack -- Logic Errors**
 
int exp(char* input) { char*token=strtok(input, ""); stack <int>num; stack <string> sym; int o1=0; int o2=0; i...
[3 replies] Last: Could anyone take a quick look at this? I am completely lost. My under... (by Gary 96)
Simple Array Handling
 
i dont understand why my code is not compiling #include <iostream> using namespace std; void entergrades (int &size) { int temp; int total; int average;...
[1 reply] : Line 13: A variable dimension is not standard C++. C++ standard requ... (by AbstractionAnon)
Implementations of Structures
 
I don't understand why my code is not compiling /* Using the program you developed for Homework 1, define a structure which supports the following type...
[1 reply] : Line 25: The ; is in the wrong place. Move the ; from line 25 to lin... (by AbstractionAnon)
Does speed determine my success as a programmer?
 
Hello I recently finished a problem that took me around 8 hours to finish. I broke the problem down before even coding and had the correct idea but implementing...
[8 replies] Last: Did you solve it in an efficient way? This is the process I used t... (by gutty333)
data structure that have these properties ?
 
is there a data structure (to contain sorted elements) where you can access items by indices and at the same time insert items at O(log n) ?
[no replies]
Calculating fee charges
 
Can't put into the right words for what I need to ask, so I'll explain what's going on. Say an internet charge costs $9.95 a month for up to 10 hours of use. T...
[3 replies] Last: Because I was trying to use a counter, yeah? I thought so, I just coul... (by Guy1988)
by iznar
Access Class Member
 
Let's say there are 3 classes A, B and C. B is inherited from A. C is a friend class of B. Can C access member functions of A?
[1 reply] : From C you can only access member functions that are declared public o... (by booradley60)
by ncaver
Rainbow Bracelet
 
for each stone: name of the stone, color of the store, weight of the stone, and price of the store colors: blue topaz, peridot, citrine, garnet, amethyst Im...
[1 reply] : And the question is ? (by SamuelAdams)
program does not compile
 
what is wrong with this program? It is in 3 separate files and I´m using Xcode. file print.h #ifndef print_h #define print_h extern const int NCOLS ; ...
[3 replies] Last: [quote=CptJY]I think you should also declare NCOLS and NROWS as extern... (by Peter87)
Using Delimiter separate string and identify that string
 
I have a string such as " ***abc 1 2 3*has 1 3 2**2 ask 21 ". You can see there are asterisks which are used for separating this string in three different parts...
[6 replies] Last: > Can you please share your code with me? Here's some code which you ... (by JLBorges)
Class constructor help please.
 
Hey guys, I need help with my hw. My teacher wants us to create constructors to a class he already created for us. Here is the header file, and the two cpp file...
[2 replies] Last: This class has exactly one explicit constructor (ctor). A constructor... (by mbozzi)
code help - error compiling
 
I'm getting an error message saying undefined reference to my function 'f' and 'pow'. Can someone tell me how to fix this? #include <stdio.h> #include <math...
[2 replies] Last: Please use code tags. http://www.cplusplus.com/articles/jEywvCM9/ ... (by integralfx)
String subscript out of range
 
Hey guys, I was doing nothing so I made myself an exercise in C++. I created a file (Password.dat) and put a aleatory code (aeggfCCDFVs222543123). Then, I wante...
[3 replies] Last: @cire I just simply let the OP know a way to fix the [Error: string s... (by SakurasouBusters)
How to know if a pointer points to dynamically allocated memory or not?
 
So I have searched on the internet and found that there is no way to find out if a pointer points to dynamically allocated memory or not. The C++ standard itsel...
[8 replies] Last: @helios Both GNU and Clang allow segmented stacks Hmm -- good to kn... (by mbozzi)
September 2016 Pages: 1234... 19
  Archived months: [aug2016] [oct2016]

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