Beginners - February 2014 (Page 52)

Not sure what is & syntax is supposed to mean here
 
Write your question here. template <typename Comparable> const Comparable & findMax(const vector<Comparable> & a ) {int maxIndex=0; for(int i =1;i <a....
[8 replies] Last: The & belongs to findmax from the point of view of the grammar, and if... (by Cubbi)
undefined reference to static private member
 
Hi guys, It has been too long since I was last here to ask a question. Okey here is my problem: I am coding a map editor for my friends game and I hav...
[6 replies] Last: Thanks for your helps (by closed account 1v5E3TCk)
dice game vectors
 
I am finishing up a dice game that takes an inputted number from the user and outputs 5 dice rolled. I am stuck on the last part of a "pair". If I get two separ...
[3 replies] Last: After the loop. How can you report the number of pairs before you've ... (by MikeyBoy)
Calculator
 
#include <iostream> #include <limits> #include <stdexcept> using namespace std; //declaring classes class token { public: char kind...
[3 replies] Last: Thanks for the answers. (by Fauch911)
by Chubby
Bubble sort
 
It come out as 100,0,0,0.... #include<iostream> using namespace std; int main() { int ten=10, holder = 0; int TenArray = {100,39,...
[8 replies] Last: http://en.wikipedia.org/wiki/Bubble_sort (by keskiverto)
Recursion
 
Can anyone help me understanding recursion and lowering its execution time? I need it in this problem! Consider the sequence of digits from 1 through N in i...
[2 replies] Last: maybe he mean about time efficiency while the program trying all the p... (by chipp)
Flagging
 
I have an alliteration: Alice’s aunt ate apples and acorns around August. I need to take the first letters of every word which would be like this: Aaa...
[1 reply] : What does the flag stand for ? Instead of getting the whole line from... (by letscode)
what's wrong with this code???
 
I wanna output the table but can't get the desired output!!! //table generator. #include<iostream> #include<conio.h> using namespace std; int table() { i...
[3 replies] Last: thnks a lot!!! ak16 it worked :) (by soldier1984)
by mora14
Gen ranNum and making the computer guess my number. (1,2)
 
Hello, I need help creating a program where the user is asked to think a number between 1 and 10, and the computer tries to (randomly) “guess” the number. T...
[24 replies] Last: I don't know. It may be my compiler or something. Or maybe i'm doing s... (by mora14)
Do while to while loop
 
Could someone tell me if the folllowing looks corrects i changed this to a while loop: int n; cin >> n; double x = 0; double s; do { s = 1.0 / (1 + n *...
[2 replies] Last: earlier code! no matter s>0.01 or not, the loop will execute one time ... (by nomijigr)
can not read from a file
 
Hıı everyone, ı am new to c++ , ı am trying to reading from a file but ıt does not work can you help me why ı can not read from a file this is my code an...
[5 replies] Last: Why are posts in this thread being reported? There's nothing wrong wi... (by MikeyBoy)
Member Data on the Heap
 
Hello! Now straight to business. I was wondering, if you had class member data on the heap, like for example int *pfoo = new int; how would you hand...
[2 replies] Last: thanks! (by geniusberry)
Or of array values
 
I want the result as M0 = 0x61626380; like oring of 0x61626300, 0x80, so it possible through operator | as i used below std::array <unsigned int, 8>...
[1 reply] : Sure. You know there are online compilers for this sort of thing? http... (by TwilightSpectre)
by alsade
why cant i reverse char array using pointer??
 
can someone please tell me whats wron with my code? #include <iostream> #include <cstring> #include <string> using namespace std; class my_string {...
[6 replies] Last: working! great thank you very much! (by alsade)
by kimi86
loop through a stack of structs
 
Hi all, I have a list of structs stored in a stack. for example: struct mystruct{ int a; int b; } instances of this struct are stored in a stack say...
[1 reply] : Show your stack. If it is a std::stack, then you will not "loop throu... (by keskiverto)
Beginner Need Help with Program!
 
Hi im a beginner at this and i need help to write a program that reads in the length of a square from the user, and computes the area, perimeter, and diagonal o...
[6 replies] Last: Youre probably going to want to use the <math.h> library as well as it... (by jidder)
What is wrong with my logic?
 
This is a java code, but the error is logic error so I guess I can get help here. So basically what my code do below is to check whether a given date is befor...
[4 replies] Last: public boolean isBefore(Date d) { if (this.year < d.year) { ... (by kbw)
by kiino
Employee Class Problem
 
Program works fine but the "cout's" aren't showing... Can't seem to figure out whats wrong :o This is the header file: #ifndef Employee_Header #define E...
[4 replies] Last: Its for a programming assignment at school. I'm trying to create a Emp... (by kiino)
modulus of data that is stored in an array
 
I had to take modulus of data that is stored in an array of 16 locations(32 bits stored on each location) unsigned int arr_1 ; arr_1 % 2^256;//modulus...
[5 replies] Last: > i had number of 512 bits and i have to calculate modulus of that wit... (by JLBorges)
Is it possible to increment using ++ besides the number one?
 
Hey all. Worlds worst programmer here. I have some issues regarding this latest torture.........oops I meant assignment. I'm basically researching data onlin...
[2 replies] Last: Yeah, nevermind, I fixed it. I'll delete the thread. (by jackbruns28)
February 2014 Pages: 1... 5051525354... 60
  Archived months: [jan2014] [mar2014]

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