Beginners - January 2018 (Page 17)

How to store 2 elements in one array
 
How do I receive two numbers from the keyboard, save them in an array of two element?
[4 replies] Last: Read SamuelAdam's link. Handy Andy showed you how. But in case it isn'... (by Ganado)
by Chaost
Can't let character through input stream
 
I'm using an if (!cin) expression to test whether user input a character or a number, but I want to let the '#' character through, as I want using that characte...
[5 replies] Last: #include <iostream> #include <sstream> #include <string> int fillSc... (by lastchance)
by zingob
string to uppercase
 
ok..this works: std::transform(st.begin(), st.end(), st.begin(), ::toupper); but why doesn't this work? for (auto it = st.begin(); it != st.en...
[3 replies] Last: Thanks a lot JLBorges and Yanson. I am enjoying learning C++ and getti... (by zingob)
I'm getting stuck with the counter
 
Write your question here. When I input these 5 numbers 50 60 70 80 90 I should get 40 but it is not happening. #include <iostream> /* run this program usi...
[2 replies] Last: #include <iostream> #include <vector> #include <numeric> #include <al... (by Thomas1965)
Problem with file reading (ifstream)
 
I am trying to load the content of a file using the following code. The file has 3 words in each line. The code should read the file and output each line. Pleas...
[7 replies] Last: yes I'm sure I do not have the file_P.h But are you sure it's not be... (by jlb)
double doesnt show behind ,
 
Solved: one has have a decimal or be a double. double x= 45/10; cout << x; output is 4. not 4.5, but 4. These are the includes: #include<iostre...
[3 replies] Last: It evaluates 45/10 first. Since neither number has a decimal point th... (by lastchance)
what in the heck randomaccess
 
so I'm still messing around with random access of a text file anyway I am trying to figure out the math in able to store the data correctly in a text file so I ...
[3 replies] Last: I can't figure out for the life of me why,the size of the first index... (by Thomas1965)
help
 
hi how to increase the size of font in c++ ?
[4 replies] Last: So, it sounds as if you just need to change your defaults and not nece... (by cire)
No Operator matches these operands
 
Hi there, I am currently revising for a C++ exam at university, and I got a question which is to do with Functions and Classes. #include "stdafx.h" #includ...
[2 replies] Last: Here's a stub for you to fill out: std::ostream& operator << ( std:... (by Duthomhas)
How to Set font size?
 
Hello everyone, Is there any way to change the font size to small during runtime by code?
[8 replies] Last: It is a relatively recent addition to the Windows Console API. Make su... (by Duthomhas)
ostream
 
Hi guys I know why I am getting an error but I don't know how to solve it I'm reading from a file called books.txt which contains the following data 1:adam:IT...
[4 replies] Last: thanks Chervil (by adam2016)
by pavik
managing menus in text mode
 
I'm trying to build up a menu for my programm. It can be found here: https://pastebin.com/DiF3CA5z My main concept was to assembling each line of screen ...
[2 replies] Last: Thx, I'll try it. (by pavik)
SFML
 
each time i press A key to move the ball i dont see any move while in console i can see the coordinates changing. secondly when i click on console menu and the...
[8 replies] Last: what is alternate for cleardevice( graphics.h ) in sfml? (by kaleemktk)
by Chaost
Function altering structure not reliable
 
I'm learning how to use pointer-to-structure to alter the value of the structure but I'm experiencing some weird behavior. #include <iostream> using namespa...
[1 reply] : At line 30, you're creating a new map object, setting the value of re... (by MikeyBoy)
OPENGL help beginner
 
I want to learn openGL for C and I cant find any reliable tutorials. Can Anyone suggest any good tutorials online. Thanks! edit PS : need Tutorial for GLUT th...
[5 replies] Last: You should never use GLUT. It hasn't been updated since 2001. FreeGLUT... (by Uk Marine)
Website C++
 
Is it possible to build a website completely in C++? If not, what is C++ primarily used for?
[2 replies] Last: There are server-side frameworks. I've used Wt, but can't recommend it... (by kbw)
by drs135
void and bool
 
Is there a way i can make this function a boolean? void bool Pacman::CollisionCheck(int x1, int y1, int width1, int height1, int x2, int y2, int width2,...
[5 replies] Last: Can't say much without your code but I would advise to check if your f... (by H00G0)
Having trouble fixing "string subscript out of range"
 
I am getting a "string subscript out of range" message when running this, but do not know what is wrong with my variable "inputchar" (it is used as an index). ...
[17 replies] Last: An easier way to count and replace words in a string. #define _CRT_S... (by Thomas1965)
Problem with void
 
I have just started to learn c++ so my code might not be the cleanest....Anyways, when I try to answer the "what do you want to do" question as soon as I press ...
[1 reply] : Problem with getting user input. [code firstline=46] int hh1ans; ... (by Chervil)
cin vs getline
 
Hi guys so I know cin reads input up until any white space,and getlien reads the whole line including the /n character but so using cin then getline after will ...
[1 reply] : Formatted input ( cin >> something ) by default skips leading whitespa... (by Duthomhas)
January 2018 Pages: 1... 1516171819... 22
  Archived months: [dec2017] [feb2018]

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