Beginners - January 2016 (Page 28)

spaces insetred into string
 
I have my code below where an int less than 32767 has to be inputted then printed, then printed in reverse and then the original printed with spaces... I have ...
[2 replies] Last: lol cheers! sorry it has been a very long day. You know when you get a... (by jamesfarrow)
Why cant output Hello world
 
Why cant output Hello world int main() { int x, c, v; if(cin >> c){ cout << "Hello world" << endl; } (it doesnt says any bug)
[10 replies] Last: I'd like to recap. 1. You want the program to start storing "values" ... (by mpark4656)
marshal_as undefined VS 2015
 
Hey all, I'm working on a GUI and I'm getting an error I have no idea how to fix. Basically I'm just trying to convert a system string into a regular string us...
[2 replies] Last: Ah yeah I finally figured that out, haven't worked with a gui in a whi... (by MattBess)
How's my progress going, good?
 
First question is, if I did go off to code what would be the true advent AI (artificial intelligence), well, I without the A, would I choose the project "Consol...
[13 replies] Last: Ok, all I still want to know that's left now is what Gibsrey meant by ... (by ADVANCESSSS)
Please help me fix this
 
First, I can input a phrase with space, ex. water bottle; second, the last total didn't print out right. #include <iostream> #include <string> using n...
[3 replies] Last: thanks a lot! @sasauke & JL Borges (by code writer)
by noaboa
Best way to check two numbers in a 3x3 box
 
Hi, I am making a sudoku game and I have managed to add random numbers, add numbers, and to checklines(if there is 2 numbers on the same line). I am trying to c...
[8 replies] Last: It's MUCH faster to use a bitset for this: // Find the first duplicat... (by dhayden)
Trying to Write a Bruteforce Program
 
Hello everybody. It's been 2 weeks since I have really started coding in c++. Today, I tried to create a little program that would try to brute force a password...
[no replies]
std::cin misunderstanding
 
I expected this code would ask both: string and integer values, but it only asked for string value. What's wrong? string myString; int a = 0; int ...
[6 replies] Last: thanks, guys! I was entering more than one word. (by elaleph)
Trying to make a factorial program
 
I've been at this for a while. I need to make a factorial program for an assignment, but all I keep getting as a result is some large negative number. For examp...
[11 replies] Last: thank you guys so much. I've never had this much progress when learnin... (by nsganon101)
Translation of python to C++
 
Hi guys recently I've been translating a python code into its c++ version. I observed that the python code had something called 'lookup' where the user could as...
[3 replies] Last: Here is an idea, go to youtube and google, type c++ map tutorial, and ... (by TarikNeaj)
Can't figure out why I'm getting errors
 
I wrote a program to demonstrate using default parameters and when I try to test it I get the errors "PrintSomethingLoop: identifier not found. #include <...
[4 replies] Last: oh my god I feel like an idiot! (by nsganon101)
by xx1182
Why const int* is not constant?
 
Take thoose exemples: { const int *a; int ab = 11; int bc = 12; a = &ab; a = &bc; return 0; } if it is a const value wh...
[1 reply] : it's because pointer is not constant, only value is constant in your c... (by codekiddy)
Templates confusion
 
I've been trying to get this piece of code to work with a template but it won't. I don't know how to get the template to work with a class constructor... Don't ...
[10 replies] Last: @naraku Yes, unfortunately it will work only for types explicitly inst... (by codekiddy)
Mathematical Issue From Compiler?
 
For some odd reason when I convert euro into pound it gives me the incorrect answer even though the equation is correct... Why? #include <iostream> u...
[5 replies] Last: Problem solved! Thanks for everyone's help. This is by FAR the best C+... (by C0D3FR3AK)
c++ Structures export data for specific name, country, last name
 
That is the structure that I created: #include <iostream> #include <string> #include <fstream> using namespace std; ...
[3 replies] Last: It should be OK. Doesn't it work? (by koothkeeper)
unsigned and signed values
 
I want to understand how the compiler gives me garbage value when I declare an unsigned int and makes it equal to -2. I know that unsigned int cannot be negati...
[8 replies] Last: #include <iostream> int main() { long aLong = -1; std::cou... (by closed account E0p9LyTq)
Cannot write struct data to a file
 
I am new to c++,and i am trying to do self learning.. I was creating a console member registration system.For that i used struct and got input from the user to...
[9 replies] Last: If you want to have a random access file your records need to have a f... (by Thomas1965)
if(cin c) - error
 
Why i get this error for: if(cin c){ cin c; } "if(cin c){}"->error: expected ')' before 'c'| and "cin c"->error: expected ';' before '...
[3 replies] Last: firstly i would ask what is the purpose of your code, what are you try... (by andrewllewop)
Function won't write out whole array.
 
When I call my function write and I input my array in to the parameters, I am unable to find the size of the array. Thus I can not figure out how many times U n...
[1 reply] : I don't know what you need the class for, but you can take the arrays ... (by cire)
Starting with C++ and Tic Tac Toe
 
I just started at a university CS program and the first language requirement is C++. So I thought that I would try to create a program with everything that I've...
[2 replies] Last: Here is my code for Tic Tac Toe: #include <iostream> #include <ioma... (by Stalker)
January 2016 Pages: 1... 26272829
  Archived months: [dec2015] [feb2016]

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