Beginners - July 2012 (Page 51)

by UDBV
Something not sleep() but just as simple
 
Someone told me that code that contains "sleep()" can only run on Windows. Having a knowledge of C++ that barely goes beyond 3 weeks in a 2 semester course (The...
[12 replies] Last: These functions don't really "sleep", they are looping-looping-loopin... (by UDBV)
by DrExd
Proof Reading Please?
 
First time attempting this problem. It takes a value and calculated prime numbers up to that value. The program works, but I am worried I might have not ...
[5 replies] Last: Thank you all for your comments and tips. They are very helpful to a b... (by DrExd)
Unix tail command
 
My assignment is to mimic the Unix tail command. For those of you who do not know it, it prints out the last n lines of a file. I think I am going to have a l...
[4 replies] Last: Looks like we're up and running :). For those of you looking for the ... (by Lowest0ne)
Help with cin/getline
 
I'm working on an exercise in "Thinking in C++" dealing with Stack structures. The following main code almost is working perfectly, except that right after I en...
[2 replies] Last: Ignore... that's a handy one. Thanks for the help LO. (by PadreDoom)
getline
 
can we use getline function throught loop to input multiple names..? my code in not working properly.. it take input in name for only once at first time.. plea...
[1 reply] : Your problem is the mix of >> and getline(). See http://www.cplusplus... (by coder777)
Array of object
 
Let's say we have a class called Test... Test test ; Book I'm reading says that this will invoke the constructor for 10 objects of type Test, even t...
[12 replies] Last: Hmm I'll have to look into what vector does in this situation. I've ... (by ResidentBiscuit)
Trouble Understanding Linked Files
 
I fear that I do not properly understand linking. When I use the following code I am unable to compile. source.cpp #include<iostream> #include<mat...
[2 replies] Last: This change did not seem to fix my problem. I now get more than just t... (by vckngs7)
function not within scope
 
I am having trouble figuring out why I am getting an out of scope error here. Here is the code. parser.cpp #include<iostream> #include<string> #inc...
[9 replies] Last: I made the declaration global just to see if the code would work. I wa... (by vckngs7)
any data type on array?
 
hey guys like my tittle above, i wanna ask you about any data type which may be used in the array, and can you explain it a little? thanks in advance ^^
[2 replies] Last: You may define arrays of any type except of arrays of void(s), referen... (by vlad from moscow)
What actually happens when you replace comparison with assignment
 
So it seems like a lot of beginners tend to replace the comparison operator with the assignment operator. I understand the confusion, but what actually happens ...
[12 replies] Last: @ResidentBiscuit What actually happens when you replace comparison ... (by vlad from moscow)
Prime Number function
 
Hi.I am new to this forum.I am developing a program which has a function that tells whether the value passed to it is prime or not.can anyone guide me with this...
[3 replies] Last: There some formula(method) to check whether a no is prime or not.I don... (by Akshit)
by pragu
What happens when we declare int main() ?
 
So what i understood was, by declaring int main() at the start of the program, the compiler instructs the OS to allocate a memory space which is equal to the si...
[5 replies] Last: From: http://en.wikipedia.org/wiki/Main_function_%28programming%29#C_a... (by ResidentBiscuit)
sting counting ?how??
 
Im trying to teach myself string but i cant get anything to display. how to you take a string and display this kind of list. I want it to look something li...
[3 replies] Last: Line 13 should be inside the loop, but it still doesnt do what you wan... (by Lowest0ne)
Unions? Why?
 
So I can kind of see where unions might have been used when computers had 1 MB ram, or less, but this is 2012! 4 GB of ram is pretty much the de facto standard ...
[9 replies] Last: 32 bytes of ram This is ridiculous haha. What's the ISA look like f... (by ResidentBiscuit)
OOP - Linking implementation and header
 
Hi guys, I started the OOP chapter yesterday, and I get most of what is happening. However, there's one thing that's not really explained that I really do n...
[2 replies] Last: Alright, thanks a lot for the information :) I'm glad to hear I didn... (by sfBlackfox)
by zoldri
hexadecimal calculator problem
 
hi, ive got a problem with a calculator ive been writing, ive managed to get user input separated into numbers and operators, but i cant get the numbers to calc...
[15 replies] Last: Cool, that's a run time error fixed. (by TheIdeasMan)
How to set values of 2d arrays c++?
 
i am working on a game and it would be very helpful if i had a 2d array to store coords how do i set values without haveing to write out line by line the values...
[2 replies] Last: Thanks I wasn't sure how to do it....of course you could go coords bu... (by supperpiccle)
by mekki
filename
 
hi, i do create a menue function that should generate separate .txt files for users. commands like ofstream are fine but i have to predefine the filename. howe...
[3 replies] Last: great txh, cheers... (by mekki)
Moving a void to a .cpp file
 
I'm apologizing in advance for the long code. I'm trying to move a void to another file (for organization) but then i need to include all of its variables and ...
[4 replies] Last: When you declare an array the size must be known. here BRICKS is not k... (by Peter87)
Why wont nothrow work?
 
#include <new> using namespace std; int main () { int i,n; int * p; cout << "How many numbers would you like to type? "; cin >> i; p= new (...
[3 replies] Last: 3000000000000 is probably more than int can store. Add some error chec... (by Peter87)
July 2012 Pages: 1... 495051525354
  Archived months: [jun2012] [aug2012]

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