Beginners - May 2013 (Page 34)

Which of these books should I get?
 
Hello all, thank you for reading my post. My name is Kane, and I've always had a bit of an interest in programming. My dad used to talk about all the stuff he d...
[9 replies] Last: I think the idea of creating your own book by writing concepts down i... (by BluesMatt)
by SmOgER
Inputting needed size of array and keeping all elements = 0
 
After such code input>>n>>k; int array ; elements of array are no longer 0, I have tried: input>>n>>k; int array = {0}; , but for some reason GNU GC...
[1 reply] : First: this: input>>n>>k; int array ; is not standard C++. gcc allows... (by MiiNiPaa)
more console closing down
 
I know that a lot has been written here on this topic. And yes, I am also new. I have written programs before (VB) but have always known what platform and OS my...
[3 replies] Last: Your program should not care about the console window. It is safe (bot... (by Duthomhas)
Variable not initialised
 
Write your question here. #include <stdlib.h> #include <stdio.h> #include <time.h> int main() { int Die1; /*Random Number 1-6*/ int Die2; /*...
[12 replies] Last: It looks like you are making a craps game simulator. Did you go any fu... (by BluesMatt)
by pata
Count duplicates
 
So im trying to go thru a list of words and count how many times the word was used, it works for the first word, then things go wrong. input and output can be s...
[3 replies] Last: Thanks for your help guys, I haven't gotten to map in the standard lib... (by pata)
Please help me!!!
 
Need help here. I get an error on line 43... please help me. My project is due tomorrow. // Beginner Programmer //Program Status = Compiling Error 11db. ...
[2 replies] Last: I don't get an error, but You can try this. int main() { TopicH... (by SamuelAdams)
by Homiee
counting inputs in an array
 
Hi, Im a beginner of c++, I'm trying to get 5 integers from user inputs and i want them to be printed out on a single line. Then i want to count the number of o...
[3 replies] Last: thanks alot for your quick helps, i tried to compile it but there's er... (by Homiee)
by SmOgER
How to make variables hold constant number of characters
 
I have a text file with a bunch of different names and integer values. Let's say I need to read them and then store in another file giving constant 10 characte...
[2 replies] Last: thanks, but what about text file, what would be the proper code meanin... (by SmOgER)
field
 
We have 2 fields - 6 numbers. Summing up homotopy elements and stores them in the third field. 2 5------> 7 3 5------>8 4 11------>15
[7 replies] Last: THIS IS RESULT. #include <cstdlib> #include <iostream> using n... (by cosa nostra)
Super Market Simulation
 
Hello, I am new on C and I want to write a program which simulates super market queues. I have 3 cash desks, 100 customers each of them has arrival time, waiti...
[3 replies] Last: Look at the top of the page. You'll see a box that says "search:" t... (by pogrady)
by jidder
Problem with basic collision detection
 
So i've decided to continue with trying to make a basic space invaders type game in the console. But i have run in to a problem with the collision detection.F...
[4 replies] Last: ok solved it stupid mistake. Just had to put the return 0 outside the ... (by jidder)
Subtracting Addresses
 
I am trying to wrap my head around the way in which variables are stored in memory, so i wrote a small program using an array of pointers to subtract two addres...
[6 replies] Last: Yes, that was also my solution. I added the following lines of code to... (by R10111001)
C++ Simple Program not running properly
 
This program is giving me a dodgy output, its meant to be a board of numbers. Thank you. #include <iostream> #include <cmath> #include <string> using name...
[3 replies] Last: Thank you so much for the help as the char values issue would have bee... (by LethalJ)
Subprogram errors
 
Hey, I am having trouble getting this to run. I have never worked with subprograms before and the compiler keeps giving me back errors. I am trying to write a p...
[8 replies] Last: Because for the program I need to have the user enter the values not a... (by Sharpie24)
Memory allocation via std::allocator.
 
Really need some confirmation on whether I got this right or not, specifically the part where the allocator is being constructed in reallocate() and push_bac...
[4 replies] Last: size() is zero, so the loop is never entered. That explains so much... (by Olysold)
by SmOgER
finding max array and it's element number
 
So in our code we have something like this: struct number{ char name ; int points ; int sum; Let's say we ran a program, it read a data from txt, did some ...
[2 replies] Last: I suggest using algorithm's max_element with a lambda to compare exact... (by Bourgond Aries)
How to draw this triangle using for loops in ncurses
 
#include <iostream> using namespace std; int main() { for (int x=1;x<=7;x++) { for(int i=1;i<=x;i++) cout<<"*"; cout<<endl; } return 0; }
[no replies]
by s1729
Integer multiplication exceeding the range
 
Hi, This is a very naive question. I am writing a code where large integers are being multiplied. Now I want to make sure that this multiplication does not exc...
[9 replies] Last: The point is that division takes too long. long long multiply( long... (by Duthomhas)
c++ ostream problem
 
I wrote these code in VS 2012, and the result puzzles me. #include <iostream> int main(void) { int n=2; std::cout << n << std::endl; // output:...
[1 reply] : As gcc (which must be what your Eclipse runs) correctly warned you, th... (by Cubbi)
Need a text-based Adventure type game for teaching
 
I am teaching a class on C++ programming. Went through the "default" book the college had for one semester - and didn't like it for several reasons. The class...
[no replies]
May 2013 Pages: 1... 3233343536... 66
  Archived months: [apr2013] [jun2013]

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