General C++ Programming - July 2014 (Page 9)

by ikan
Reducing the time complexity
 
I have a very simple program the time complexity of the function that I used in this program is O(mn)because it has a nested loop, I really need to reduce the ...
[5 replies] Last: Thank you all :)))))))))) (by ikan)
please help
 
can u please find error in the program........it runs upto enter month and continues without stopping......it executes infinite times #include<iostream....
[3 replies] Last: Line 1: Correct header for modern compilers is <iostream>, not <iostre... (by AbstractionAnon)
Binary and String File Protection
 
Hello, I am using private copy constructors to protect my string and binary files. I am wondering if anybody knows how to write to a binary or string file f...
[no replies]
by Gamytr
Double, int and float. See the differences.
 
I don't know where I made the mistake #include <iostream> using namespace std; int main() { int x,y; float a; double b; int c; cout<<"Birinci sayi...
[4 replies] Last: Thank you :)) (by Gamytr)
by nines
Needed explanation
 
Hi, I need help with this code : 1. # include <iostream> 2. # include <cctype> 3. using namespace std; 4. 5. int recursion(int array , int temporarly...
[3 replies] Last: myesolar & lsk thanks for the tips I will google it and find out (: (by nines)
explaining of codes
 
can someone explain the function below to me void readFile() { ifstream read("bs.txt"); ofstream fout("tmp.txt"); int roomNo, levelNo, time, durati...
[3 replies] Last: The code seems to do "silly" things and might not even work properly. ... (by keskiverto)
How to know if a variable has been accessed
 
I wondered if anyone knew how to tell whether a variable has been accessed in memory, no matter what it's been used for... Whether it's actually been set to som...
[4 replies] Last: The variable isn't encapsulated, it's just a standard C++ primitive va... (by TheBeardedQuack)
by bairsh
large array of objects isnt freed
 
Hello, strange behaviour have seen with large array of objects in the following code. If class internal array has length 100 memory is freed after delete . B...
[5 replies] Last: Thanks for the clarification. I'm not able to test the 4.1Gb version a... (by Chervil)
Dangling Pointer Memory
 
I appear to be having difficulty freeing memory and I think that it may be causing leaks, I could use some assistance in figuring out what to do.
[5 replies] Last: No need to use new for those temp objects, and with the exception of... (by duky)
Is the expression with multiple '<<' full?
 
Hello to everyone. I need to implement simple wrapper for logging function log(const char *). So the solution is below: #include <stdio.h> #include ...
[2 replies] Last: Thx (by alexvein)
C++ 2D game library
 
Can you recommend me a 2D game library ( NOT a game engine ) that is similar to Apple's SpriteKit, but works on Windows/Linux with C++? I use SFML 2.1, but I wo...
[5 replies] Last: Thank you very much! I built SFML from sources and added the SFML incl... (by memberfunction)
explaining of codes 2
 
and this function too void writeFile() { ofstream fout("tmp.txt");//opening file"bs.txt" for writing temp=head; while(temp!=NULL)//while data in ...
[no replies]
c++ vectors struct dilemma
 
i want to know what the struct is being used for if everything is being stored in the tmp variables and pushed into the vectors, why is vector<type> given as ...
[no replies]
Random function better than rand()?
 
So I need my program to very rapidly spit out random numbers. Now I don't remember where I read this, but I recall that rand() works with the clock in some way,...
[17 replies] Last: @cire: if i use a function attribute, that isnt guaranteed to be port... (by cire)
The progran flashes
 
Hi. Why is it that the program doesn't stop for me to see the output? Here is my code: // accessing mapped values #include <iostream> #include <map> #include ...
[1 reply] : http://www.cplusplus.com/forum/beginner/1988/ (by helios)
Struct: Help with my grade function please
 
My code has no errors. I'm just having problems with getting the grades of the file sorted. grades is not a struct, but is a int inside struct School. Below is ...
[2 replies] Last: BTW, you press 'g' but check for FirstName ! if (student .name.firs... (by lsk)
Please help
 
I have this program, this is giving junk/garbage values in output: Statement: take input from user in first 3 columns of each row.add these 3 columns and print...
[1 reply] : @ammar9493 You have a few problems with your program, and it's not do... (by whitenite1)
Using vectors vs arrays.
 
So I'm new to C++ and am trying to understand inheritance. Specifically in my cod below i'm looking how to call my functions. I know how to do this when my...
[12 replies] Last: I had to start over since I believe I made far too many mistakes. In ... (by cjust689)
Help with audio
 
Since im bored and don't have anything better to do, I was wondering how do I play a simple mp3 through my mic. I plan on using this to just play annoying sound...
[6 replies] Last: So you can hook audio? that's AWESOME and exactly what I was looking f... (by ScriptKiddy123)
Trouble with player jumping on 2D Gravity based map
 
So, I've recently been working on a side-view, 2D game using a 2D array for a map. So far, world generation, drawing, and everything else is working out great. ...
[no replies]
July 2014 Pages: 1... 7891011... 26
  Archived months: [jun2014] [aug2014]

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