General C++ Programming - July 2015 (Page 10)

standard library or boost
 
hello I am new to C++ programming and would like to say I love this site it has helped me familiarize my self with the standard library. I have been doing s...
[2 replies] Last: Hi JLBorges, Thank you very much. Thats what I was hoping to hear, I ... (by wunderbred)
Help with Program
 
I have a program for my C++ class and I have no idea what to do or get started cause we did not learn it in class. This is the program: For this assignment, yo...
[4 replies] Last: Simply construct a loop that looks at each character. Then for each c... (by axtyax)
Library implementations (i.e lists, arrays)
 
Is there a way to see library (i.e. pointers, lists, arrays) implementations and their class functions such as insert(), delete(), makenull() in actual code lik...
[2 replies] Last: The Microsoft CRT source is provided with Visual Studio; check out the... (by andywestken)
can't access constructor vars
 
rc\main.cpp:16:10: error: 'class A' has no member named 'p' (a.p).If I create object and access its member(a.z) then program runs with no errors. The differenc...
[11 replies] Last: Thx! (by technologist)
Picking all possible cases.
 
You are give an array containing 'n' elements. You are given an integer k (input). You must find all possible sets of 'k' elements from the 'n' elements. How to...
[6 replies] Last: Yeah. I just checked it out. It works. Thanks for the solution! (by ShankRam)
Strpbrk function
 
Any idea how would I test this thing? char * strbrk( char *s1, char *s2) { char c; while ((*s1++ = c) != 0) { ...
[5 replies] Last: Hi, Why not just use brute force? If you would know how to use it, I ... (by pacman169)
by Gyiove
Creating your own std::vector like class from scratch (1,2,3)
 
Hello everyone! I've been looking at headers like vector , xmemory and stdexcept and there is alot of stuff i dont understand. I looked c++ tutorials als...
[42 replies] Last: First of all that operation probably won't trigger reallocation at all... (by MiiNiPaa)
Binary tree remove function
 
Why do I get a segmentation fault here? Where do I violate memory access? void BTree::del(int x) { del(&root, x); } void BTree::del(Node ** n...
[13 replies] Last: and min() int BinaryTree::min() //public { return min(root); } ... (by johnny cash)
Best practices for checking valid input in OO design?
 
What is the best practices for checking valid input in a Object Oriented design? Consider the following simple example, where we have a class Person which ta...
[2 replies] Last: It is a good idea to make constructor check invariants. If constructor... (by MiiNiPaa)
by anhnha
Pointer to x or y element of CPoint
 
Assuming that I have an array of points with type CPoint. CPointArray arrpt; //arrpt is an array of points CPointArray* parrpt = &arrpt; Now can I have the ...
[3 replies] Last: What is the pointer to the second member (y) of the array? Pointer t... (by MiiNiPaa)
loop until correct added
 
If I type a char in int datatype input then the loop becomes infinite. I tried to handle it but can't. However, my program is: #include<iostream> using names...
[1 reply] : When you input characters, cin>>number tries to read it. However it ... (by MiiNiPaa)
by noaboa
Problems with getting string
 
Hi, im trying to save and load some text to a file you decide to get the name on. After that you need to add some "secret" text, and then you need to type a wor...
[6 replies] Last: Thanks for the help (by noaboa)
by memouz
pass string to DLL
 
Hi there I need help with c++ string I am MQL4 programmer I know how to pass any value to dll and return it from my language but the string value thats ...
[11 replies] Last: Thank you mr Gamer2015 I use windows 7 I tried that but that text I s... (by memouz)
by nicode
GNU libstdc++ custom std::codecvt linker error
 
I developed several custom converters and want to comment on the archived topic http://www.cplusplus.com/forum/general/18596/ (MinGW custom codecvt facet VTABLE...
[2 replies] Last: Many thanks for the comments. But your example code derives from the e... (by nicode)
Replacing letters in a string(A with Z; B with Y; C with X; D with W; etc)
 
Hi ! Im trying to create a program that will replace letters in a string(A with Z; B with Y; C with X; D with W; etc). So if i input: CAR -> XZI B...
[3 replies] Last: It seems like you are replaceing one letter at a time (all A to Z, the... (by MiiNiPaa)
How many constructors are in the person class above?
 
Consider the implementation of the following class class person { private: int age; int getAge(); void setName(string); public: string name; per...
[2 replies] Last: How many constructors are in the person class above? Yeah, Five but ... (by Gamer2015)
by st3pha
Cin inside a function inside a process looping
 
Hi, I'n trying to do a simulation, I need to enter (cin ) floats like a,b,c,d,e,f,g. and use them in a function V which provides like 10.000 data. so know the p...
[no replies]
Output of this code snippet?
 
What is the output of the following code? int x = 0; int i; for (i = 0; i < 4; i++) ; x++; if (x == 3) cout << "*"; I believe it is just *, but ca...
[2 replies] Last: Actually, as it stands, there will be no output. If you click on the l... (by andywestken)
time.inl and error C2664
 
I found this file in a game I'm working on: /*** *time.inl - inline definitions for time-related functions * * Copyright (c) Microsoft Corporation. All ...
[1 reply] : If anyone cares I figured out the answer to this problem. You can sol... (by bishoposiris)
Installing matpack C++ library
 
Hi, I am installing matpack c++ library from the source http://www.matpack.de/ and getting some problems. While calling make, it says /Makefile.version does not...
[no replies]
July 2015 Pages: 1... 89101112... 15
  Archived months: [jun2015] [aug2015]

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