General C++ Programming - January 2015 (Page 3)

Fill in code
 
I am completing an assignment and I am trying to fill in my missing pieces of code. I have competed this thus far but I still need to print with two decimal poi...
[8 replies] Last: Variable. How does one declare a variable? How does one change the v... (by keskiverto)
error C1004: unexpected end-of-file found & '{' : missing function header (old-style formal list?)
 
#include <iostream> #include <string> using namespace std; { int counter=0; string Username; string Password; string InvalidUser; int opt; ...
[1 reply] : using namespace std; { //<Why is this brace here? int counter=0; ... (by MiiNiPaa)
Memory allocation wrapper affects caller function parameters?
 
I'm using wrapper functions to allocate and check all my pointers, which are allocated/freed with malloc/free. For some reason when I call zalloc, the stack get...
[3 replies] Last: @cire: Do you mean the dealloc variable? This points to a function whi... (by superfury)
Confusion with the auto type and other types
 
constexpr size_t rowCnt = 3, colCnt = 4; int ia = { { 3, 6, 9, 12 }, { 2, 4, 6, 8 }, { 1, 2, 3, 4 } }; fo...
[2 replies] Last: Thanks for the response. I tried a similar approach but I had forgotte... (by Vesparo)
delete
 
delete
[4 replies] Last: Probably he did it so that his teacher cannot find this post. (by TheHardew)
How to delete a line in a textfile using c++?
 
The program i wrote can run but did not work. I want to delete a line from the textfile "StaffList.txt" but when i cin the name, for example "Ben". After the pr...
[2 replies] Last: It worked!! Thank you :) (by krystalting2)
by Dkob1
Check solutions C++ operator quetion
 
Need help/ check if they are right, thanks. int a=3, b=5, x; x= a/b + b/a +a%b + b%a; cout << x; // x=0+1+0+1= 2 y=float(b/a)+ float(b)/a; cout << y...
[1 reply] : Don't double-post across boards. http://www.cplusplus.com/forum/begin... (by booradley60)
Problems using pointers with Function
 
Hi. I always have confusions while using pointers with functions both as arguments and as return type . Can someone please give me hints to use on this??...
[1 reply] : //return_type (*fp)(argument_type); #include <iostream> #include<vec... (by sujitnag)
Passing Dynamic Multi-Dimensional arrays
 
If any one is on this late I could really use some help. I need to create subfunctions to do basic Matrix mathematics (addition, subtraction, etc.) I need to be...
[1 reply] : The parameter are passed like so: Matrix_Addition ( Matrix_A , Ma... (by coder777)
by Dkob1
How do you use e to power of in this case? (1,2)
 
so I have this, I'm trying to use the formula B=Pe^(rt) , P is dollars deposited in an account for t years with the interest rate of r. How do I use e to the po...
[25 replies] Last: Wow, it looks so much easier than I made it out to be. Thanks (by Dkob1)
by zevxc
Big O help
 
Would the big oh notation of the Algorithm of: for ( j = 0; j < n; j++ ) { for ( k = j; k < n; k++ ) { <some operation> } } be : O...
[4 replies] Last: It's a bit more complicated (due to k=j) : O(n 2 - ((n 2 - n) / 2)).... (by coder777)
issues saving and loading from txt file(strings w/ whitespaces)
 
hey guys, I am having issues with loading the string "Dirty T-Shirt" from a text file i use to save my game with. When I load it, it splits it up. Like (t...
[5 replies] Last: Thank you, that took care of it! (by Skwidman157)
by Dkob1
Menu question ?
 
cout << left << setw(5) << "Menu" << right << setw(5) << endl; cout << left << setw(5) << "Coke..........." << right << setw(5) << 2.10 << endl; cout << "Ha...
[1 reply] : #include <iomanip> #include <iostream> #include <string> int main() ... (by MiiNiPaa)
by Dkob1
Help, why is it not working?
 
#include <iostream> #include <string> #include <cmath> #include <iomanip> using namespace std; int main() { //declare variables string name; ...
[7 replies] Last: Thanks, think I got it. (by Dkob1)
Why isn't this program running?
 
Hey guys, I am pretty new to C++ programming, but I don't know what is wrong with this program. Any help will be appreciated. Thank you. // Naive_Gaussi...
[2 replies] Last: thank you so much, it works now! (by maximus87)
Decimal to Binary
 
Hello, I have never done C++ before and I am having trouble writing a program in lab. This is due pretty soon and I really need help. Can someone write a progra...
[3 replies] Last: Good luck. #define _CRT_SECURE_NO_WARNINGS #include <iostream> #inc... (by closed account 2UD8vCM9)
Diamond Class. Please Help (1,2)
 
I am in an object oriented programming class and I need to figure out how to get this to print out properly. it prints out in a diamond shape but it is missing ...
[25 replies] Last: last 5/7 years not programming cpp. overall i programming in diff lang... (by sujitnag)
Negative number
 
For my program, we have to make our own class and implement it through our choice of Offense or Defense. This piggybacks off an assignment I asked about last we...
[1 reply] : sorry boss, give an example to understand your project. input, interna... (by sujitnag)
error: undefined reference to `__glewDeleteBuffers'
 
I'm working with OpenGL and glew32 and, while trying to do some work with buffer functions, came up with these errors: In function `ZN6spriteD1Ev':|25|undef...
[6 replies] Last: I included the build libraries like you told me to: #include <SDL.h... (by captpman)
by zevxc
Help With Recursion
 
I am not asking for you do my homework im just really confused on the question that is being asked can anyone explain what my HW is asking? Create a method t...
[1 reply] : Well basically that function uses recursion to do the following: Retur... (by closed account 2UD8vCM9)
January 2015 Pages: 12345... 24
  Archived months: [dec2014] [feb2015]

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