Beginners - June 2017 (Page 11)

by Dagr
Fibonacci's 150 member
 
Hello.I have some problem. I musc count fibonacci's 150 member. As i know borders of int isn't enought so here we need BigInt.I have ready project of counting b...
[5 replies] Last: If you start the series 1 1 2 3 5 8 ... then the 150th Fibonacci numbe... (by lastchance)
by Ephan
Help with calling functions in int main()
 
Hi guys, I hope someone can help me with this code that I am stuck in at. #include <iostream> using namespace std; struct money { int dollars; int cent...
[8 replies] Last: Thank you all so much, guys! Now it works as I want to. Here is the ... (by Ephan)
calculate the slope intercept
 
hi guys, I am working on a calculation for a homework assignment, and I am pretty new in C++. So sorry if the question seems silly. I am working on a calcul...
[2 replies] Last: shoot.. thanks! That explains why my output wasn't working! Okay, so... (by JasperTheFriendly)
stable_partition algorithm doesn't work correctly !
 
i know that partition algorithm partitions the container into 2 parts by the predicate argument without sorting each part; but stable_partition sorts each part...
[2 replies] Last: thanks, iam sorry i thought that preserve means sort :) i didn't trans... (by AhmedEl3agamy)
by Arcy
Copying a C-string into an array in a structure
 
Greetings all, I'm able to do the exercise below using std::string, but I can't get it to work using the pointer-to-char, as intended by the author. I tried...
[2 replies] Last: That solved it. Thank you! (by Arcy)
Help solving Rate and Hours Problem
 
kjl
[1 reply] : A beginner mistake is thinking that if they post the same thing in mul... (by SamuelAdams)
by Snow14
Question about characters
 
So hi everyone ,i hope that you are doing well; this is just to test it's a part of the code that i have to write for my homework; i have a problem in the 2 las...
[3 replies] Last: Hello Snow14 The only reason for the while loop to fail is if the con... (by Handy Andy)
by TheArk
decimal move
 
Hello, I was wanting some tips on how I can go about moving the decimal point of the answer to weight, to show exact amount of change. I have tried setprecisio...
[5 replies] Last: Awesome it worked, thanks (by TheArk)
Pointers vs Reference
 
char* p = 0; is valid char& p = 0; is not valid Can someone explain what the compiler actually does step by step for the first and for the second so that I...
[9 replies] Last: they are supposed to be, and for the most part, are. If you really t... (by jonnin)
by akar1
random number generator
 
this is a random number generator code but i want to know why the number 11 never show up int main() { srand(time(0)); int random = rand()%11; c...
[2 replies] Last: Hello akar1, As I have often seen: int random = rand() % 11 + 1 ; ... (by Handy Andy)
by pzaw
Opening any file
 
This code which is used as an example all over google works InFile.open("c:\test.dat",ios::in|ios::binary|ios::ate); compiles and understood. Howe...
[3 replies] Last: Thanks everyone for your valuable contributions. pzaw (by pzaw)
Beginner with cpp and h files - help
 
Hey, I'm new here, and I'm learning C++ you help me if this right?, is it professional? BTW I'm using, Visual Studio 2017 win32 debug main.cpp #include ...
[2 replies] Last: Hello Cyndanera, Not much I could add to what mbozzi said,but for the... (by Handy Andy)
Detecting/Scanning non top-level windows.
 
How would I detect if a program is running not on the top-level? If it were top-level i'd just use FinWindow(), but I am yet to find an alternative of FindWindo...
[3 replies] Last: > but with the CreateEvent() would that event be deleted when my progr... (by JLBorges)
I need help creating condition in last if statement to see if major2 is empty.
 
#include <iostream> #include <string> #include <cctype> using namespace std; int main(){ double gpa = 0.0; string major1 = ""; string maj...
[2 replies] Last: You can use std::getline to extract a string that has whitespaces. htt... (by integralfx)
C++ Detecting key presses etc
 
So I am trying to detect when VK_BACK is held so it can delete a full sentence for example if i type 'I am typing this.' and hold down backspace it will only de...
[9 replies] Last: I didn't say seconds :) You might be amazed at what 5 - 10 hz buffere... (by jonnin)
by RezaAb
Passing a 2D vector to another class
 
Hi All, I am trying to make a copy of a 2D vector which is private and located in class A to the class B. I am thinking a get function but I have an error in d...
[3 replies] Last: ... trying to make a copy of a 2D vector which is private and locat... (by gunnerfunner)
please help fast with "[Error] invalid conversion from 'int*' to 'int' [-fpermissive] "
 
I’m confused I wrote a program for an assignment that is almost identical to this one (it worked fin) so I copied 85% to this one. But in this one I get an er...
[3 replies] Last: thank you guys for your help (by lonewolffcoder)
while(file.good()&&!file.eof()) run once more
 
Hi, When I run the following code, the while loop will run more once time. The file contents are: A_LABEL,A_NAME B_LABEL,B_NAME C_LABEL,C_NAME(END OF FILE) ...
[2 replies] Last: Cubbi's answer is wonderful. (by waschbaer)
by Rodev
Error: pointer being freed was not allocated
 
Hello, I am working on a "line-oriented text editor" for my CS course and I must use the List container. I created a member function that prints all eleme...
[2 replies] Last: jonnin, Thanks a lot!!! :D You are totally right! my for loops for t... (by Rodev)
by toko
C++ graphics failing to execute in codeblock
 
Hi. I have followed all the steps for graphics, getting all the required header files and libraries from http://winbgim.codecutter.org/ and also pasted the link...
[1 reply] : The WinBGIm version you’ve downloaded is bugged. Following the link ... (by Enoizat)
June 2017 Pages: 1... 910111213... 16
  Archived months: [may2017] [jul2017]

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