Beginners - January 2015 (Page 4)

by chip x
C++ uint16_t color
Hello, I do not understand this: uint16_t color or uint8_t value . What is "_t"? The parameter "color" is no comma separated? Thank You
Jan 29, 2015 at 8:10pm
[3 replies] Last: Yes, color is a variable. What are you confused about? The sentenc... (by AbstractionAnon)
explanation
i was reading this section and have a question http://www.cplusplus.com/doc/tutorial/functions2/ // template arguments #include <iostream> using nam...
Jan 29, 2015 at 7:32pm
[2 replies] Last: A non-type template argument of an integral type must be a constant e... (by JLBorges)
by Dkob1
Area / Perimeter of triangle
I don't get why area is not working? #include <iostream> #include <cmath> #include <iomanip> using namespace std; int main() { //initialize ...
Jan 29, 2015 at 6:53pm
[6 replies] Last: I thought it would change automatically after I made p= (a+b+c)/2 N... (by dhayden)
logic explanation requested.
can someone please explain how "x" is equal to "2" int a, b; a=2; b=3; float x; int main() { x = (float)((a+b)/2); std:cout << x; } ...
Jan 29, 2015 at 6:13pm
[4 replies] Last: thank you. (by wanderwizard)
endl
So I'm trying to complete this for an assignment. I need to print a pyramid of stars using 2 ways: the first with 4 cout statements; and the second with only ...
Jan 29, 2015 at 6:02pm
[5 replies] Last: You can use the new line character '\n' instead of endl. \n doesn't fl... (by HatchetMan302)
fibonacci sequence help
Hey guys, I'm writing some code to output a fib sequence up to a certain term. My problem is that it adds one more to the sequence.. ex if i enter 9 terms it re...
Jan 29, 2015 at 5:39pm
[3 replies] Last: @dhayden Thanks for the reply, i understand it now. (by CpluspProgrammer)
Read Word file into String Array
Hello, working on a school project and asking for sanity check of my code. I have a word file single column of 3 characters each that I have to read into a stri...
Jan 29, 2015 at 5:23pm
[3 replies] Last: You need to pass in the wordsArray as a parameter. If it's a local var... (by dhayden)
array of pointers confusion
The purpose of the code is to practise on an array of pointers. I want to see this output: touch the surface I would like to receive some corrections to ...
Jan 29, 2015 at 4:39pm
[5 replies] Last: Sorry, I can't help myself: You're using <iostream> and namespace std... (by tipaye)
C++ Craps game
I have gotten this far with my program (to make a working craps game with two randomly generated dies), but at the moment I am at a stand still because as soon ...
Jan 29, 2015 at 4:17pm
[2 replies] Last: also lines 27, 28, 42 and 43 have no effect If you really want the us... (by tipaye)
by Dkob1
Basic operators question - simple
I'm not sure but I think some of these are wrong but need someone to check thanks. int a=3, b=5, x; x= a/b + b/a +a%b + b%a; cout << x; // x=0+1+0+1...
Jan 29, 2015 at 2:23pm
[1 reply] : Why don't you just test it? Anyway: errors in first two lines: 1) 3 ... (by MiiNiPaa)
While loop for adding numbers infinitely
Write a program that will read in a list of numbers and print the sum of the numbers and the average. (Note: your program must work no matter how many numbers a...
Jan 29, 2015 at 2:22pm
[8 replies] Last: Perhaps I'm missing something. When you wrote a static_cast is most c... (by dhayden)
by Dkob1
Math Basic question C++
Would this print out a+C+5 ? cout << int('a')+int('C')+int('5'); int x=17, y=15; cout << x+y/4; // =20 cout << x%3+4; // =...
Jan 29, 2015 at 2:20pm
[8 replies] Last: #include <iostream> #include <type_traits> int main() { static_a... (by JLBorges)
Why should i use this??
Hello, I'm wondering what the benefits of iterators are? //stl style iterator QString::const_iterator i; for (i = str.constBegin();i != str.con...
Jan 29, 2015 at 1:17pm
[1 reply] : http://stackoverflow.com/questions/131241/why-use-iterators-instead-of... (by mutexe)
Create <MyLibrary> instead of "MyLibrary.h"
Hi, as u all see by looking at this title i want to create library like <iostream> <cstdlib> instead of "my_project.h" so i wouldn't always have to make ...
Jan 29, 2015 at 12:36pm
[2 replies] Last: Thanks for reply man, i will check this out :) (by etrusks)
[answered] Checking value of several slots in array with Switch statement?
I am new to C++ and I am trying to put together a little tic tac toe game. I have it figured out except for validating whether there is a winner. I have 9 slot...
Jan 29, 2015 at 11:57am
[3 replies] Last: For any other beginners who may be interested in seeing what my "final... (by namethief)
CUDA programming c++
Hi everyone I mean to implement my c++ codes with CUDA, I have windows 8 and vs2013 installed on my machine.is there any step by step tutorial to help me with ...
Jan 29, 2015 at 10:29am
[no replies]
Cin.width Problem?
Cin.width is not limiting the number of characters read from a string. Any explanation why it isn't working? I want to take the users name, but only store the f...
Jan 29, 2015 at 9:08am
[3 replies] Last: cin.width is not compatible with strings, only cstrings Wrong. JLBor... (by MiiNiPaa)
Compare Two Arrays
I'm trying to make a program where two arrays with 10 digits each are compared to one another. The program will then print out the number of matches. So far my ...
Jan 29, 2015 at 7:40am
[2 replies] Last: Thank you. That did give me the number of matches , but now I would l... (by iByakuya)
by Sh0es
Overloading the << Operator.
I'm struggling to get my code to compile, but I currently have only one error in my innermost class. #include <iostream> template <class T> class ArrayList ...
Jan 29, 2015 at 6:05am
[5 replies] Last: In answer to your question, @Sh0es, we probably need to see at least t... (by TwilightSpectre)
User Defined Functions
In my class I am supposed to write a program with user defined constants and user defined functions. We are given tuition cost of $50 per credit hour and a one ...
Jan 29, 2015 at 5:53am
[4 replies] Last: Edit: Nevermind I figured it out! Thanks again Pin! (by iByakuya)
January 2015 Pages: 123456... 39
  Archived months: [dec2014] [feb2015]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.