General C++ Programming - June 2014 (Page 2)

by judo11
How can I search for an Item in the array?
 
If the item is in the array. Count how many times it is stored in the array and what are their respective array locations. How can I add this output in my p...
[3 replies] Last: The OP does have a loop (line 9), but there are a few problems with it... (by AbstractionAnon)
looking for library for bar code scanner
 
I'm writing a pc application that will need to use a bar code scanner. However, instead of spending money on an actual price scanner I plan to just use my smar...
[1 reply] : https://code.google.com/p/zxing/ (by Duthomhas)
by Cpper
Zombie close to the player
 
Mob is Zombie Player is player The thing is I am trying to make that Zombie will spawn far and I want it to slowly come close to the player but the Zombie spa...
[1 reply] : It doesn't answer your question, but your game is totally buggy. I wou... (by iQChange)
Help
 
I need help understanding this code used to print N prime numbers : #include <iostream> using namespace std; int main(){ int N; cin >> N; for(int ...
[1 reply] : The indentation doesn't reflect the actual structure. Here is the code... (by dhayden)
Finding Prime No.s
 
I am new to programming using c++ and I want to make a program that prints the first N prime nos.when I debug it doesnt give me the desired output for example I...
[5 replies] Last: Perhaps you should read some introductory material, for example the ht... (by keskiverto)
Cannot dereference variable in a set...
 
Hello everybody, will be grateful is somebody can help! I get errors C2100 (illegal indirection) and C2088 ("<<": illegal for class) while trying to use the ...
[4 replies] Last: Great!!! Thank you, works like a charm! (by nemecfc)
by judo11
How to convert c++ Pseodocode into a program for searching the value of an array.
 
What is the program of this pseodocode? Set found to false. Set position to -1. Set index to 0. While found is false and index < number of elements ...
[5 replies] Last: Well this is a "first attempt" you could complete the rest. //searc... (by eyenrique)
About recursion void
 
Hi, i am newbie in c++. I hope you can help me to write what the meaning and output of this subprogram. I am really confused. string stc; void coba(in...
[2 replies] Last: I deeply wanna thank you, Stewbond... Your answer is awesome, it is he... (by anakkampung)
When to use structures in c++?
 
Hi, Can can any body tell explain me when to go for structures and when to go for classes in c++. Since both supports access spcifies,member fnctions and inh...
[5 replies] Last: That first comment That comment wasn't here when I read it the first ... (by MiiNiPaa)
Hello everyone. I need a help
 
I need to write a program which shows calendar for the whole year. By using only <iostream> and <conio.h>. User iserts only the number of the year. Pro...
[4 replies] Last: Guys, I will be thanksful if you share your experience (I'm beginner) ... (by sukhrob)
Acyclic Visitor Pattern with polymorphic visitors
 
Acyclic visitor pattern used here to count the number of elements of a certain type in a container. struct A { struct Visitor { virtual ~Visitor() = ...
[1 reply] : #include <iostream> #include <string> struct A { struct visitor ... (by JLBorges)
by chhe
peculiar libcurl library error
 
I have been trying to get the libcurl library to work with the following program shown below but I have been getting the following error: ||=== Build: Debug ...
[2 replies] Last: Yeah it still doesn't work. Originally under Linker settings I clicked... (by chhe)
Alpha Zone just won't be Alpha
 
Hi Everyone, I found a targa loader that works great and implemented it in my code. But for some reason, the alpha region of my texture , just won't be alpha...
[1 reply] : Should you be setting the blend mode before you draw the quad? You'... (by Disch)
PN-AEN indices algorithm
 
I was following this article (http://developer.download.nvidia.com/whitepapers/2010/PN-AEN-Triangles-Whitepaper.pdf), and there is an detail explanation how t...
[no replies]
by Kubani
Making an octagon out of right triangles
 
Hello all, One exercise says that, " Define a right triangle class. Make an octagonal shape out of eight right triangles of different colors. " Making such a ...
[2 replies] Last: Thank you. Yes, that's right. I do the exercise. (by Kubani)
by BasV
sizeof trouble
 
Hi everyone, I made a little piece of code that generates a random name for my window, but I have some unexpected behaviour. This is the code: srand(ti...
[3 replies] Last: It's an old feature that C++ inherited from C. (by Peter87)
using ternary operator with overloaded constructor
 
hi, I have two possible questions; can you use a ternary operator to initialize objects with overloaded constructors like class thing { int x; ...
[4 replies] Last: Ok, that makes sense if it can only take expressions. I had seen you c... (by Nogroth)
reverse polish notation in c++
 
Question-->http://www.spoj.com/problems/ONP/ I m not able to find the problem in my solution . I m new to C++.My solution is working fine for the test cases ...
[3 replies] Last: What it says is that the input will not contain infix expressions that... (by helios)
Passing 2d array
 
Hello, I'm wondering if it is possible to pass a 2d array to a function where the size of the array is not known at runtime. I've tried function ( array...
[2 replies] Last: To add onto that article.... A 2D array is really an array of arrays.... (by Disch)
Weird memory assignments
 
Hi, I was writing a program and ran into something I really dont understand.. Does anyone know why the 'temp' variable inside the constructor has the same addre...
[3 replies] Last: Oohh. Ok, thanks (by Nogroth)
June 2014 Pages: 1234... 21
  Archived months: [may2014] [jul2014]

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