Beginners - March 2014 (Page 76)

Game Over when life is less than or equal to zero?
 
I have this code. Can someone help me print ("Game over") to the program when the health of the log/rock goes less than or equal to zero? Thanks. #inclu...
[2 replies] Last: In every if statement put another if statement like this: if (type==... (by jasongog)
Program with other alphabet
 
I am Greek and in my language the alphabet is Capital letters: Α Β Γ Δ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ Φ Χ Ψ Ω Not capital letter...
[3 replies] Last: You might want to try this: http://cppcms.com/files/nowide/html/ To us... (by MiiNiPaa)
Calculator will not add two or more digit numbers
 
Hello, I would like to know if anyone can fix this program for me, so it`s a calculator and the problem is that if I type 1+1 . It works fine but when I type i...
[6 replies] Last: Sorry cire, your second code worked. Thank you. :) (by closed account EwCjE3v7)
Making loop with skipping an argument
 
Hello. I need some help with making loops. I'm just starting with programming. Let's say I have a code like that #include <iostream> using namespace st...
[3 replies] Last: Thank you both, finally I can continue my work on studying C++ :) (by xTripper)
by Alby94
constructors
 
Why in this piece of code he is using a private attribute of a class as a constructor? http://www.cs.fsu.edu/~lacher/courses/COP5517/lectures/loki5/slide10.h...
[2 replies] Last: Thanks for all...now i understand all!!! =)) (by Alby94)
I have a SimpleVector as a class member and I'm getting left of '.push_back' must have class/struct/union
 
I have tried changing the transactionVector to contain doubles instead of transaction objects and I get the same error message. There doesn't seem to be anythin...
[2 replies] Last: Ok thanks for the tip. I think I have it working now. I changed the de... (by theperson)
linked lists
 
Hey , i had written this code to swap the max value with last element in the liked list and to swap the min value with first element in linked list. the min co...
[no replies]
Is this a proper way of expanding array size dynamically?
 
Hi guys, I am wondering if this is the proper way to do the array expansion... Does the line "ptr1 = ptr2" cause memory leak? Because initially both ptr1 an...
[2 replies] Last: ok, thanks (by selenium)
by alsade
question about array's merge function
 
i have two problems with my code: 1) inside the function im trying to create array but i cant initialize with the size i tried too....why is that? 2) even if ...
[no replies]
by kimi86
constructors
 
Hi there, is there a good resource which explains the difference between move, copy,promotion, default and assignment constructors.. i cant find these too eas...
[1 reply] : http://www.cplusplus.com/doc/tutorial/classes2/ http://www.stroustrup.... (by Catfish666)
Square Root
 
I was wondering if i can make a program which finds the square root of a number without using sqrt(). Can anyone help me?
[13 replies] Last: So i can do static_cast<string> (num) to convert an int to a string... (by jasongog)
Make Costume variable.
 
Is there a way to create a costume variable. I want 3 dimensions array, with first dimension string, 2nd float, 3rd int. Could you tell me if is it possible?
[6 replies] Last: hey thanks. When I tried to implement it in I coudnt figure more effic... (by Townsheriff)
linked lists problem
 
Hey, i made a linked list contain 4 nodes and i want to delete the second half of the linked list >> it dose not work with me #include<iostream> using ...
[2 replies] Last: well thank you for your advice's , i know a little bit about the memo... (by max v max2)
Resize Array Passed To Function As Param
 
I am trying to re-size an array passed as a parameter in a function. The problem is once I am done copying the array and I go to delete the old array the progra...
[1 reply] : oldArray in function is actually a pointer. There would be no differen... (by Peter87)
by sda
infinite loop...write a program to tell you how many months..
 
You are to write a program to tell you how many months it will take to pay off any loan, as well as the total amount of interest paid over the life of the loan....
[4 replies] Last: hey thanks for all the help. I made the appropriate changes in the lo... (by sda)
Can anyone help me with ifstream?
 
what am i doing wrong? I am kinda new to c++ ,and i don't see what is wrong with this code. I am using Dev C++ 5.6.1. void write_file () { string ss = "C:\"...
[6 replies] Last: Thanks people. You helped me write this piece that works. Sarcasm, y... (by Catfish666)
print the sum of the first n cubes
 
hey, guys for some reason i can't get sum3 and sum4 to print 225 which the sum of first 5 integers when n is 5. the formula for sum3 is (1+2+3..n)^2and sum4 is...
[3 replies] Last: but 1 more question i was getting sum3 wrong because i didn't get the... (by Catfish666)
by samara
assignmnt on classes
 
it is a question on classes in order to get total charge of syrgery done medication taken, daily rate fee of hospital and then at last calculating the total cha...
[no replies]
Random number
 
I made a function which, normally, generates a random number. But when i run the program it always shows this result 2 8 5 1 10 5 9 9 3 5 6 6 2 8 2 2 Th...
[1 reply] : http://www.cplusplus.com/reference/cstdlib/srand/ (by Yanson)
by qzpqzp
Do I have to put the file somewhere?
 
Do I have to have the file saved (I have it saved in My Documents) in a particular folder? It's not giving any results. #include <iostream> #include <f...
[2 replies] Last: Uh.. I'm just a Freshman, I created a random Notepad file. And... It'd... (by qzpqzp)
March 2014 Pages: 1... 747576777879
  Archived months: [feb2014] [apr2014]

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