Beginners - August 2014 (Page 21)

cin question
 
Hi, I just learned about looping in c++. I came across two questions that I was unable to answer. I need help understanding the idea. 1) Is the following state...
[12 replies] Last: Let's take this statement: 1, 024; According to the way the comma o... (by cire)
Taking input as condition into while loop
 
In C I can write the following code. There is no error. while(2 == scanf("%d %d", &n1, &n2)) { ... ... ... } But in C++ when I write the following...
[4 replies] Last: that's what while continue and break does. you may also want to ma... (by codekiddy)
Am I using std::unique_ptr the wrong way?
 
I'm using gcc-4.9.1 to compile this code that list the contents of directories recursively. I tried to wrap the DIR ptr in a unique_ptr but then it doesn't comp...
[4 replies] Last: I get it now. That is why clang was giving this: error: data member in... (by ch4k3r82)
Reading data from a text file into variables and arrays
 
Hi, I'm trying to read a text file and store the data into some variables and arrays. Here is an example of the data: param T := 3 ; param alpha := 1 1 2...
[1 reply] : You can load the file into a stringstream for easier manipulation. Als... (by Aceix)
Dynamically created objects seem useless, don't understand.
 
Hello. So in order to create a C++ object on the heap, you need a pointer on the stack. To me, it then seems useless, because you have to have declared the ...
[7 replies] Last: Thank you cire! (by heyyouyesyouiloveyou)
Indirect Object?
 
Hi What is an 'Indirect Object' in C++? Thanks
[2 replies] Last: I typed "Indirect Object' in C++" into google and the only link from r... (by codekiddy)
Repeating Loop
 
This is a totally trivial console program but I'm new to cpp and I can't figure out how to make the menu redisplay if the user inputs the wrong answer. Thank...
[3 replies] Last: Then what does happen when an out of range number is entered? This wa... (by Chervil)
by T4l0n
loop in switch
 
I wanted to have the loop closing when value x is 1, 2 or 3, it works if i write only x!=1 but with or operator i can't manage to make it work, thanks in advanc...
[3 replies] Last: thanks (by T4l0n)
understanding code
 
Hi, I am currently learning about loops in c++. Recently I came across a topic called 'end of file' condition. The following code was provided as an example in ...
[9 replies] Last: :O) (by Duthomhas)
code question
 
Hi, I just learned about looping in c++. I came across the following problem: Write a program that asks the user to type in numbers. After each entry, the progr...
[1 reply] : one problem is that size of an array must be known at compile time: ... (by codekiddy)
structs
 
Hi guys. I have a question about structs. This is an example from the site here. Outside the struct they have mine and yours. Why are they outside and why cant ...
[1 reply] : mine and yours are struct instances, these are the actual objects whos... (by codekiddy)
by Zloi
Getting text from the lineEdit
 
I'm sorry for the, I think, most stuoid question ever asked, but how can I get the text from lineEdit in Qt and put it into a variable? This doesn't seem to wo...
[6 replies] Last: Oh< Thank you! (by Zloi)
struct and SetConsoleCursor
 
When I step through my program using VS13 debugger it works correctly but when I let the program run on its own it only outputs my 'x' to the console completely...
[2 replies] Last: Lol, no one even helped you. (by long int main)
Adding an 'if' statement into a 'switch' statement.
 
Ok, I'm trying to use a 'switch' statement, but with two possible scenarios for one of the switches. If the time is greater than 1min, I want it to output the ...
[3 replies] Last: Ok, got it working now. Thanks for the help. Can't believe I overloo... (by Ascendant78)
by RCB123
Doubt about code in C
 
Hello people I'm new in this. I'm trying programing this code but is saying me "Error: expected unqualified-id before if" And my code is this: if (ign.ign...
[6 replies] Last: Yes i follow each step (by RCB123)
by LKrebs
Send via serial? Help needed.
 
So, I'm having a small problem. It's probably extremely easy to solve but any help is much appreciated (I'm a complete C++ noob). The compiled version of the f...
[no replies]
Hi I'm recently started to learn c++
 
My goal is to learn how to create video games and i would like to know what is need in order to do so. I have been seeing people using SDL and something called ...
[2 replies] Last: Your best bet is to start learing DirectX. because it has the best doc... (by codekiddy)
Image Display (1,2)
 
I learned some console application and win32, now I want to learn how to display an image. I don't know how to do it and what compiler to use. Can you please te...
[34 replies] Last: I guess I can't ever close the topic now, since my other account got b... (by long int main)
Returning Static Reference
 
Hi I'm new this forum. I just joined because of an issue I couldn't figure out. I'm developing a matrix class for a Linear Regression Project I doing in my free...
[9 replies] Last: > invalid initialization of non-const reference of type 'matrix<floa... (by ne555)
by Ch1156
SFML 2.1 movement help (1,2)
 
Ok so I just started learning SFML and I love it so far and i'm trying to get a sprite to move fluidly but i cant seem to get it right. When I move it takes a s...
[30 replies] Last: Nevermind I did it :D I just stopped and did it step by step of what t... (by Ch1156)
August 2014 Pages: 1... 1920212223... 40
  Archived months: [jul2014] [sep2014]

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