General C++ Programming - May 2013 (Page 19)

Block Cipher (File Handling) - Error: malloc.c
 
Hi, First of all, sorry about somewhat long code (~400) lines. Relevant bits should be small. I am writing a code for block cipher IDEA http://en.wikipedia....
[no replies]
Filling array, not working correctly
 
Hi all. I wrote a Simon game, and wanted to save the top 10 scores. I was working right, until I decided I wanted to still be able to read the file if someone e...
[4 replies] Last: @andywestken Thanks for the explanation as to why my way was not work... (by whitenite1)
How are members accessed in AMP restricted methods?
 
Suppose I have a class "A", which has a method "void AMP_call()" that calls paralel_for_each in which another method, "float amp_function(float) restrict(amp)"....
[9 replies] Last: Also found this: Note that capturing the “this” pointer is also ... (by ausairman)
C++ University assignment
 
Hello there. I have an assignment from my university, I am making a simple trivia application on Visual Studio. the thing is that i didnt have a course on vi...
[6 replies] Last: Operator is += not =+. Also, if you want to make a GUI app, I recommen... (by Aceix)
"Global" idiom, and your opinions?
 
It's common to hear that the use of global variables is bad practice in C++. However, I've found them to be fairly common in e.g. Windows API examples. In many...
[2 replies] Last: You had almost invented singletones :) The problem with globals (aside... (by MiiNiPaa)
[Follow up question]The complicated code ever
 
_V3Signals = (_v3signal **) new char[sizeof (_pscsignal **) * (_max_v3_signals + PSC_NOMPINS)]; This code look so complicated.Could you explain to me w...
[16 replies] Last: I know both also assign dynamic memory.But what is the diff ? The sa... (by MiiNiPaa)
Defining Classes and using them inside void main()
 
Hey guys..this is a program I developed in which we had to define a class named BOOK with the data members and member functions as shown in the program..We have...
[1 reply] : from 43 to 48..the line feed was also used at many other places but t... (by Peter87)
by mrju5t
Howto loop this function?
 
#include <iostream> #include <string> #include <cstdlib> #include <algorithm> using namespace std; //BEGIN FUNCTION PROTOTYPE void redactDigits( ...
[2 replies] Last: You could make that easier using an iterator. More easier, using C++11... (by Aceix)
by BillH
passing class members to function in c++
 
Hi there. I have been trying to get my head around this all week with no success. I have a procedure in an SFML program, that basically bounces a shape around t...
[8 replies] Last: Just to let everyone know - thanks for all your advice, I have now got... (by BillH)
by Aceix
Testing C++11 lamdas
 
Hi all, i recently created a programme that checks if a string is a palindrome, using a lambda. Unfortunately, it does not work. When I type "ama", it does not...
[1 reply] : Thanks for reading. Anyway the problem has been solved. How? isPalindr... (by Aceix)
Urgent !! please enter
 
hey guys , I am supposed to write a recursive function which find the partition of a number n ,, for example if n=3 , it should print 1 1 1 , 1 2 , 3 I wrot...
[3 replies] Last: This is one (more or less de facto standard) way of writing the loop: ... (by JLBorges)
<string>
 
I just started as a begginer in c++ coding and i got a doubt here there is a pre-processor directive #include<string> i had made a program including string va...
[4 replies] Last: thanks L B. (by vedulak95)
How does #define _USE_MATH_DEFINES work?
 
How does #define _USE_MATH_DEFINES work? How can you just magically define it like that and math constants will be available to you? Is there something in...
[9 replies] Last: Oh thats true. Good point (by Anmol444)
Beep not working.
 
Beep function not working (I do not have administrative access). Also, I get an error of ERROR_MOD_NOT_FOUND. Any reasons why? #include <windows.h> #include ...
[3 replies] Last: They are newly updated, using Orwell Dev-Cpp 5.4.1 newest version as o... (by closed account 18hRX9L8)
Typo in my book
 
From my book: " // Can.h for Ex9_10 #pragma once #define _USE_MATH_DEFINES // For constants in math.h #include <math.h> #include "Container.h" ...
[no replies]
error: expected unqualified-id before ‘.’ token
 
i get an error at this line rootset::generations.push_back(pmemSize/gen); The structure is designed like this struct rootset { unsigned long totS...
[5 replies] Last: rootset::generations AnObject; AnObject.push_back(pmemSize/gen); ... (by Daleth)
Friend Functions
 
Cbottle.h: #pragma once; class CCarton; // Forward declaration class CBottle { public: CBottle(double height, double diameter) { m_Height = height; m_Diameter...
[12 replies] Last: Can someone please help! (by Anmol444)
Completely wrong Output
 
Here's the code: #include<iostream.h> #include<conio.h> #include<stdio.h> struct FLIGHT { int Flno; char DepTime ; char ArrTime ; float Fare; }...
[2 replies] Last: Thanks Miinipaa but this is for my school assignment and I can't help ... (by Winkerd)
Need help with space shooter in SDL! (1,2,3)
 
Hi everyone, I'm really new to SDL and i've been trying to make a spaceshooter game, so far i've got a ship you can move around in using the arrow key (square s...
[53 replies] Last: Thank you so much fun2code, sorry it took so long to reply! I've now g... (by Laurence)
Anyone want to work with me!
 
Sup, I am wanting to work with someone on anything they wish. As long as it is a long term large project of course I will do a lot of work. It has been ages si...
[6 replies] Last: Dang, if you were only interested in programming video games. I am 18.... (by MaxterTheTurtle)
May 2013 Pages: 1... 1718192021... 47
  Archived months: [apr2013] [jun2013]

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