Beginners - January 2017 (Page 17)

while loop to for loop
 
Can i know how to change while loop into for loop ? int x=10, y=0; while(x-- > 0) { if(x % 2==0) y++; }
[5 replies] Last: @Chervil @joe864864 Thanks for the reply. Both were good explanation ... (by DesmondLee)
One of my first programs, I want criticism. (Text Adventure)
 
I started making this text adventure. It very very short currently. I am new to programming and this is my first go at an actual program. I am open to critisism...
[4 replies] Last: 1. Inconsistent variable naming. 2. goto 3. Code identation. 4. Split... (by codehelper)
Returning from classes
 
Hey all, here's what I got this time. I'm doing a "Bulls and Cows" game, where the computer has a word, and the user has to guess the word. The number of "bulls...
[no replies]
C++, The Good Parts
 
What do you see as the most important, relevant features of today's C++? What are the most important topics to learn? A little background to put this questio...
[13 replies] Last: but for mere humans In the interests of avoiding the wrong end of th... (by closed account 48T7M4Gy)
by mthe25
create a chessboard with squares of any size
 
Write your question here. class Image { public: typedef uint16_t PixelType; private: int width_; i...
[no replies]
Node
 
All the nodes in a singly linked list are arranged sequentially by linking with a pointer. A singly linked list can grow or shrink, because it is a dynamic data...
[4 replies] Last: Check the create_node method in the link (by gunnerfunner)
Customer Data
 
I am a beginner when it comes to programming and I learn better visually when it comes to writing code. Once i see the code i can then figure out what it is doi...
[6 replies] Last: However it says the variables are undefined. It looks like there i... (by TheIdeasMan)
Bugs With My Program That Uses Selection Sort
 
Hey, I am unsure what I have done wrong in my program that I wrote that is suppose to sort 10 integers from least to greatest and output them. I want some help ...
[1 reply] : Hi, Have you used a debugger? Hopefully there is GUI one in your IDE.... (by TheIdeasMan)
emulate big (integer) numbers
 
Hi all friends. I want to work with very long integers but memory (allocation) sets a limit to them. The limit of say 4,294,967,295 is to limited for the purpos...
[4 replies] Last: Thanks for the tip PanGalactic. I'll pick it up from here and will hav... (by peterbaaij)
by Jaif
Program crash?
 
Hello, so basically this program is to measure distance mile, yards, feet and inches. When I try to build and run program below it crashes. After checking debug...
[3 replies] Last: @Chervil Thanks it fixed it @PanGalactic I was trying to make cin op... (by Jaif)
stream to integer and limit
 
Dear friends. How am i going to check if an input (integer in this case) by string stream exceeds the systems limits. I can inquire what this limit is by using ...
[5 replies] Last: cheers Thomas (by gunnerfunner)
Code Blocks crashes
 
Hey, I've written a program for my uni and whenever I run it, input couple numbers the program crashes. The idea of the following program is to have 2 functions...
[5 replies] Last: Shouldn't tr = new int ; be 2 instead since an array with size 2 h... (by cire)
Same elements of 2 arrays copied into an empty 3rd array
 
Hi everyone! I am fairly new to C++ and I'm trying to learn it a little bit deeper. At the moment, I am learning how to deal with arrays. I tried to creat...
[2 replies] Last: @lastchance Ah, I see. This particular one I wanted to do without tr... (by Armannn)
How pointers and references inhibit inlining
 
Stroustrup writes that pointers and references inhibit (function) inlining. Can anyone explain why this is so. Thanks
[1 reply] : I found this: https://isocpp.org/wiki/faq/value-vs-ref-semantics#inli... (by TheIdeasMan)
OOP
 
The result is xx:48 xx:48.Could someone explain me the result? Thanks class Bike { private: char* brand; public: Bike() { brand = "xx"; } ...
[2 replies] Last: I think what confuses you is that b1 which is of type EBike is passe... (by yanevski)
I need help understanding how forward referencing works, or how to cross reference classes
 
In short words, I was trying to understand how forward referencing works inside a document, and I was trying to make this code compile: #include <stdio.h> i...
[15 replies] Last: 'Favour not having user-defined names that begin with an underscore' ... (by JLBorges)
Codelite issue
 
I'm new to codelite so I'm sure this is a simple fix but I have no idea what to do. I wrote one program and ran and tested it no problem, but now I'm working on...
[no replies]
by stat1c
Find letter function
 
I need to write a function that gets a letter from the user and checks the list to see if that letter is in the file. This is my file: Alabama Alaska Arizona...
[2 replies] Last: I've tried something different but when I type in a letter and press e... (by stat1c)
Snake Game Chrono Problem
 
Write your question here. I'm trying to implement powerups in Snake, for example: when the snake collects the powerup, the speed increases for 10 sec (using Sl...
[1 reply] : This program keeps polling in the while loop until four seconds have e... (by xismn)
How to divide this circle into 2/3 quadrants and fill each quadrant with a color?.
 
How to divide this circle into 2/3 quadrants and fill each quadrant with a color?. #include<graphics.h> #include<conio.h> #include<stdio.h> #include<...
[6 replies] Last: @Troat Look specifically for "IEEE754 binary32 floating point". This ... (by mbozzi)
January 2017 Pages: 1... 1516171819... 24
  Archived months: [dec2016] [feb2017]

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