Beginners - March 2017 (Page 28)

Snake game!!!
 
I set two if statements in the logic function in case i hit the wall or i eat a fruit represented with "F" but when i run my program nothing happens.Why? #in...
[2 replies] Last: I just briefly looked your suggestions but definitely the rows 103-112... (by spax1111111)
Even/Odd help
 
Write an expression that evaluates to true if the integer variable x contains an even value , and false if it contains an odd value .
[15 replies] Last: Hah, this after my epic doh post above, where I mangled it beyond reco... (by jonnin)
feedback for ADT Sort Linked List
 
Just looking for some helpful feedback on an ADT Sorted Linked List constructor. SortLabListP.H //******************************************************...
[2 replies] Last: SortLabListP.cpp: line 12: last is uninitialized. Lines 19 & 23: su... (by dhayden)
by fx11
namespace question
 
error: 'a' in namespace 'Rectangle' does not name a type error: 'b' in namespace 'Rectangle' does not name a type But why? #include <iostream> using ...
[6 replies] Last: I think I see. Thanks. #include <iostream> using namespace std; in... (by fx11)
Issue with Xcode product output as document instead of Unix Executable
 
I am new to C++ and Xcode. I am currently running Xcode 8.2.1 on Mac OS Sierra 10.12.3. I recently created a new project using code from my C++ lesson book cr...
[no replies]
Change for, into While loop
 
How can I change this for loop into a while loop? for(int p=10; p>=0; p-=2)
[3 replies] Last: int p = 10;//initialize outside while loop while (p >=0) { ... (by gunnerfunner)
Simple function header
 
I'm studying for a C++ test and I want to make sure I got the answer write. The practice question says: Write function header only- function PrintIt which will ...
[1 reply] : you have been given the function name: PrintIt , the return type: I... (by gunnerfunner)
Struct and finding sum and average
 
Hi, I have written this code here for my programming project and I have finished almost everything but when I build the solution, the code couldn't compute the ...
[2 replies] Last: Thank you so much, I was thinking I did it wrong in arithmetic but I d... (by silver11235)
Multidimensional array
 
Hello, Is a 100x100x100 array much much more complicated and calculation intensive than a say, 5x5x5 array, even though we will only have only few, same number ...
[2 replies] Last: Depends. It is likely that the 100x100x100 will not fit in your cpu c... (by jonnin)
Help with inheritance, derived classes and their functions
 
Hi guys, I’ve got what is probably a very basic question about inheritance, but I’m relatively new to this so please bear with me. So, say I have a cl...
[6 replies] Last: Ouch... that makes my head hurt! That's important stuff to know thoug... (by sunjinsak)
Explanation needed
 
I have to eliminate the middle digit of a number. Example:12345--->1245 1234---->14 Below is the correct code for this exercise: int n,k,x,...
[1 reply] : I had qualms about replying to this, as I don't believe it is "the cor... (by lastchance)
Vector/SDL Issues
 
I'm using SDL to read paths from a text document. This works fine, and I have a list of all the textures loaded displaying on the side just fine. bool load_t...
[1 reply] : GUESS WHO IS A BIG DUMBDUMB HEAD? I WAS RENDERING THE TERRAIN THEN CLE... (by tristan1333)
Infile Outfile C++ Visual Studio
 
Please help in terms of Visual studio: Need to read an infile, square the numbers within the infile, and outfile those numbers to a new document. I AM LOST! ...
[1 reply] : while (inFile) { sqrt(number); inFile >> number; outFile... (by integralfx)
Prime Factorisation
 
... this code isnt working for some reason that I have yet to know... anyways...(it worked for some numbers) #include <iostream> #include <cmath> #include <st...
[3 replies] Last: Hi, Your algorithm for finding the prime factorization of a number ... (by ElusiveTau)
Need help with infile/outfile
 
Need help understanding how to read numbers from a text file, and square rooting those numbers to an outfile. Had missed class today and am utterly lost. ...
[2 replies] Last: Can someone also help me? I have an exam tomorrow and I am required to... (by nicholasjb1996)
How to find average
 
I have this program that I am supposed to have a program that writes the sum and how many quarters. I am mainly just wondering how to find the average sales per...
[2 replies] Last: average is just sum/quarters preferably as a double. double avg = (do... (by jonnin)
I need assistance in making a counter for a C++ program.
 
make a Counter for the following Code below. #include <iostream> using namespace std; int main () { std::string company_name; ...
[3 replies] Last: The program runs fine here: http://cpp.sh/7ropo (by gunnerfunner)
print function vs ostream operator C++
 
Question: For printing outputs, do I use ostream& operator<<(){} or a void print(){} ? Note: I am using a class called class_name, and in order to access t...
[8 replies] Last: > how is this related to operator overloading << or print functions th... (by JLBorges)
resize capacity function C++
 
For ... delete arr; // delete old arr // arr = new int ; arr = new_arr; // assign new_arr ...
[5 replies] Last: I personally would say to either use malloc and realloc, or use a vect... (by jonnin)
by Nakruf
PathCombineW gives unresolved exetranl symbol
 
The error is in PathCombine but I can't find the solution to the error. I also included the function for getting roaming dir. Severity Code Description...
[1 reply] : You need to add the library Shlwapi.lib to your project. In Visual St... (by Thomas1965)
March 2017 Pages: 1... 2627282930... 36
  Archived months: [feb2017] [apr2017]

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