General C++ Programming - December 2013 (Page 5)

Arrays of Strings Vs. Arrays of Pointer to Char
 
I have a simple assignment of just putting month names into an array of pointer-to-char. I thought of doing it like: char * months[ 13 ] = { "Jan", "Feb"...
[4 replies] Last: Yes, that's correct. For all user input, just use std::string .... (by Duthomhas)
Class MyTriangle
 
Write a class called MyTriangle, which models a triangle with 3 vertices, is designed as follows. It contains: 1. The MyTriangle class uses three MyPoint ins...
[3 replies] Last: The stuff they provided in line 3 isn't valid C++ that can be just cop... (by Albatross)
Regular Expression
 
How to match the string in the following format 12\15\13 using regular expression. The format is not changing but data will change like 11\22\14. Do not consi...
[4 replies] Last: Regular expressions are pattern matching, so for everything in your st... (by Duthomhas)
Programing Calendar
 
Hi and happy cristhams I am programing a calendar to much time but i cant realize that the compiler can translate these, i dont know i am making bad, i put t...
[4 replies] Last: your code is not easy to read..... make it simple .. you can use funct... (by thefasninja)
About synthesized default constructor?
 
A compiler auto created default constructor is called a synthesized default constructor. It will initialize the built-in members to 0 or not depends on where th...
[3 replies] Last: Thanks, JLBorges! (by northfly)
void foo(int (*M) [10]) {} can be written as void foo(int (M*) [10]) {}?
 
The pointer * can be before or after the ID?
[4 replies] Last: I guess so, too! Thanks! (by northfly)
Function hide or overload question, about scope, overload
 
we all know if there are void print(double); //defined globally and then void fooBar(int ival) { void print(int); //local funtion print(3.14); // wi...
[2 replies] Last: Thanks, Cubbi! That helps! (by northfly)
bogous
 
Hi. Isn't this class definition class WordCounter : public Mapper { public: virtual void Map(const MapInput& input) { const string& text = input.value(); ...
[1 reply] : > How cab const string& text be assigned something? In line 4: const... (by JLBorges)
array from string
 
#include <iostream> #include <string> using namespace std; int main() { string s="Last Assignment/n"; cout<<j <<j <<j ; i dont...
[6 replies] Last: > dont understand how it printing each element of whole string.like L... (by JLBorges)
non-copyable
 
Hi, Need your help. How inheriting a noncopyable class with a private copy constructor and an assignment operator is going to prohibit the use of copy constr...
[2 replies] Last: @QTsik: > So why you need derive form noncopyble if want have possibil... (by JLBorges)
by tomka
FAT32 - parse root directory
 
Hi friends! I'm trying to parse the root directory of FAT32 in order to get a dir list in the root folder. So I need to go over all the directory entries in...
[1 reply] : Go to: http://forum.osdev.org/ Read: http://wiki.osdev.org/FAT (by Catfish666)
unordered_set without c++11
 
Dear all, c++11 offers a nice data structure called unordered_set, which offers all the facilities of std::set (other than keeping elements sorted), and it i...
[2 replies] Last: Thank you! (by panecasareccio)
by TSLexi
Advice on refactoring this Enigma cipher program
 
Hi fellow programmers!  I was looking through a few old programs I wrote, and I came across this Enigma cipher simulator. I was wondering if you could help ...
[2 replies] Last: I guess the formatting I had somehow got removed. The Enigma algorit... (by TSLexi)
Defining macro function.
 
So never used macros much but after seeing some code from verius open source projects i think i need to start using them more. Anyways i made this macro. #...
[1 reply] : Solved: #define GET_NUM_LENGTH(nNum) \ (sizeof( nNum ) / sizeof( int... (by WetCode)
How to move the 'smiley' in my code automatically and stop the screen flickering?
 
Hi guys, So far I have managed to write the code for a simple game (resembling to "Pacman") :P. Now what I want is to move the smiley in the upper left-hand ...
[8 replies] Last: I've given you some pretty step-by-step instructions. Try them first. ... (by Duthomhas)
Ackermann's Function (Super slow with std::cout, Instant with out std::cout, why? )
 
Ok so today I got a weird one. How come if I cout the values this can take forever to finish. But when removing std::cout and only doing the math its done in a ...
[2 replies] Last: Ok thanks for your reply. Cheers (by WetCode)
How to call a function from a derived class in the base class?
 
Hey guys i need help! I spent hours and hours looking online but none had the same problem as me. Basically, I have a base class called MainShop and it has 3 de...
[4 replies] Last: Okay i tried exactly what you said, but i get this error! Ld /Users/D... (by damian519)
Windows form
 
Hello! My question is, how do I add a button with such properties so that when I click it the window that is open changes? To simplify my meaning; I have ...
[15 replies] Last: The Microsoft Reference manual for VC++ 2012 can be found here: http:... (by Largins7)
reversing n characters in a string
 
Hi, I have a string like str="ABCDEFGHIJK"; need o/p like this str="CBAFEDIHGJK" am getting "CBA" correctly after that its not printing anything....
[10 replies] Last: Why don't you just edit his example so it works for a variable number? (by Zhuge)
Multiple files
 
This is a rough idea of my code, What I have now works wonderfully. My problem is it takes 6-8 minutes to compile every time I need to make a minor change. I lo...
[5 replies] Last: level.txt: Diamond Shovel Saddle Milk Bucket #include <iostream> #inc... (by LB)
December 2013 Pages: 1... 34567... 37
  Archived months: [nov2013] [jan2014]

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