General C++ Programming - March 2014 (Page 10)

2D array + switch statement to move char
 
Hi guys just making typical console game where hero moves with w a s d. However, in my code, while a and w work (minusing), s and d dont work (adding). I hav...
[no replies]
WORST Case Time Complexity
 
I am finding the Worst Case time complexity for Bubble Sort, Selection Sort, Insertion Sort, Linear Search, & Binary Search.. For the worst case time complex...
[1 reply] : http://www.cplusplus.com/forum/beginner/126196/ Yes insertion sort wi... (by Smac89)
by cpd
if statements not working?
 
I'm trying to figure out how I'm supposed to include the string into the if statement. In this, my latest, attempt the random generation works but no matter wha...
[3 replies] Last: Here's the pseudo-code: 1.) Accept user input number 2.) Does the use... (by xismn)
signness of 0
 
Is it really needed to specify 0 as an unsigned integer? I mean 0 is always 0 regardless it's signed or not, no? In the below example is the 0U really needed? ...
[5 replies] Last: I think in that particular expression, the signedness of 0 is irreleva... (by helios)
Prime Number Long way
 
So let's say I have couple numbers 10 13 22 99 10000 345 5834 5567 how i test if they are prime or not using the long way (like square root)?
[1 reply] : For large numbers that would require too much memory for all the numbe... (by giblit)
Multidimensional Matrix
 
Hi everyone, First of all, sorry my english (I am spanish and I don't know writing english very well). I have a doubt about how to go through a multidimension...
[7 replies] Last: I have been seeying the boost library docs from your link but there g... (by Cubbi)
by helnow
print repeated array of 2D
 
I need help with Printing duplicate 2D array elements if for 1D array for (int i = 0; i<0; i++){ for (int j = i+1; j<0; i++) { if (arra == arra ...
[5 replies] Last: > it is also to do it in a four nested loops right? Yes. (by JLBorges)
by Mylar
How can you switch between Boolean true/false logic within a do/while loop?
 
Hello, I have a hit a snag in a number guessing game program. I was given a half-completed program and told to use functions to complete the missing pieces. It ...
[4 replies] Last: Thank you in the sincerest way possible. You've cleared up a wall-bang... (by Mylar)
Can I using oledb failoverPartner?
 
Hi guys, Now I'm using oledb in order to database connection on the c/c++ application program Provider=SQLOLEDB;Data Source=127.0.0.1,1433; FailoverP...
[no replies]
memory addresses and comparison operators?
 
It's logical to compare two memory address to see if they are equal or not. It is logical to increment to the next or previous memory address. But does it reall...
[3 replies] Last: @Cubbi, you know what, now I remember reading this in the book. Yes, y... (by johnmerlino)
delete[] keeps giving me error
 
Hello everyone! I'm new around here. School assigment, yadayada... Here's my situation: Whenever I try to change an user's data (By using the _Set functions b...
[5 replies] Last: Almost. Do +1 on the returned value of strlen instead of the string po... (by Peter87)
Program skipping switch case second time through while loop
 
Hello all! I've got something rather strange going on here in an assignment for school. The program runs fine the first time through, but when trying to go back...
[no replies]
send outpot to char buffer instead of &cout
 
I have lots of code like this ... (*output equals &cout) *output << "none ("; *output << target->getName(); *output << ")\n"; is there a simple ...
[4 replies] Last: How can I clear ss ? ss.str(""); (by naraku9333)
fstream
 
I do have a homework assignment. I have been pulling what little bit of hair that I have out over this, as the textbook that I have does not reference what I a...
[5 replies] Last: FYI you can use //some code == //some code around code instead o... (by giblit)
Boolean function not returning false
 
I have a bool type function and set it to explicitly return false, but I am still getting true as the return. #include <iostream> #include <fstream> using ...
[7 replies] Last: Sorry, but I don't believe I was being rude. What you did is somethin... (by MikeyBoy)
Problem Opening Data FIle
 
I have been wot=rking on my social secutriy EXAMPLE program from a book i have to prectice input files in c++. It wont open for me when i run the program tho. w...
[no replies]
by Humots
Repeat a sequence of random numbers using rand_s()
 
I am using Microsoft Visual Studio 2005, and I can use Microsoft Visual Studio 2008 if necessary. I am using rand_s() to generate pseudo-random numbers. I...
[no replies]
Calculate # of days between dates - program continuously runs
 
I have an assignment to write a program that will calculate the number of days between two dates (including leap years). We have to read the data from a file an...
[7 replies] Last: Aha! That did the trick! Thanks so much, you were very helpful! (by DaveDew)
by jbush
proproblems with"makefile" in windows 7 64bit
 
I'm having a really hard time executing a makefile for the Cambridge University baking pi lesson 1. In a directory, I have dir template, containing (dir (build)...
[no replies]
fstream is inaccessible
 
Ok, so my problem is that for some reason my fstream (named "myfile") is inaccessible in my cpp file. I will show you the code for the involved methods and the ...
[7 replies] Last: that may be because of the default open mode of fstream ( in|out ) use... (by ne555)
March 2014 Pages: 1... 89101112... 36
  Archived months: [feb2014] [apr2014]

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