General C++ Programming - June 2013 (Page 3)

Segmentation Fault
 
I can't work out why I get a Segmentation Fault with my C++ program. Could please guide me to an answer. Here is the code: #include <iostream> #includ...
[5 replies] Last: Huh, I works perfectly for me, I get no errors/seg faults at all on Li... (by thePHPdev)
We need to help with new Tomb Raider engine
 
Hi there :) Do you know about old Tomb Raider games? If so it would be great. We need to help with programing of a new Tomb Raider Engine called Open Tomb. Ple...
[no replies]
Declare class member outside of constructor.
 
Basically, I need to set a variable outside of the constructor and make it accessible to the entire class. It would need to work something like this: #...
[5 replies] Last: You cannot define a class data member from a function. (by cire)
by sumsar
linked list
 
I posted this in the beginner forum but with no luck. Im trying to make a linked list / lobby, but for some reason when I try adding a New element it crashes w...
[5 replies] Last: thanks that solved the problem :D (by sumsar)
by ehab93
isPrime fun
 
can anyone tell me what's wrong with this fun!! it doesn't work with big numbers ! bool isPrime(long n, long count) { if (count >= n) return true; ...
[18 replies] Last: oh .. it's squrt n . .ok got it (by ehab93)
Interesting dynamic function execution issue
 
Hey guys, I've got some functions and macros that I want to execute based on a string input that matches the function's name. I came across as this being a pos...
[3 replies] Last: Thanks for the swift response. I'll see how it goes using something li... (by ENIGMAx)
Binary operators
 
Hello, I've been looking at binary operators lately.. And I don't quite understand some of them.. I know how to use bit shifting but I don't understand the r...
[3 replies] Last: Oh okay... Thanks! That was really helpfull :) (by thefatshizms)
Equivalent site for c#
 
- Being that i recently started learning and doing research in c#, i wanted to ask all of you if you knew of a site that is similar to this one and is based on ...
[7 replies] Last: @Disch, @ResidentBiscuit: - Thank you both for your assistance. (by thejman250)
Correct allocation of memory inside methods/functions
 
Good night, The problem is the following, I am making a wrapper object of sockets in c++, since the ones in c are somewhat ugly, and not quite OOP. I can't ...
[3 replies] Last: ¿how does passing a pointer would make a difference? (by ne555)
by nmn
adding floats
 
Hello All, I am very new at c++ and ran into this problem. pairPercentage = ((float)tempPair/hands) * 100; flushPercentage = ((float)tempFlush/hands) *...
[3 replies] Last: 1.4013 e-44 is a too little value. It does not influence on the valu... (by vlad from moscow)
Pseudo code
 
Write a program that prompts the user to enter an item#, the program should determine if the item is in the file and print the price of the corresponding item. ...
[2 replies] Last: Hey, please try not to double post. This was already posted by you in ... (by ENIGMAx)
Game of Life
 
Hi everyone, I am struggling to write a program for Conway's Game of life. I am a relative beginner so my mistake may seem obvious. I am getting a problem wi...
[4 replies] Last: You would want to create special cases that target only the boundary c... (by ENIGMAx)
if statement always false[not solved yet]
 
firstly sorry for my bad english secondly i am still learning about c++ and i am trying to make a ticktacktoe game. I made a simple one with no ai but i decide...
[7 replies] Last: thank you my friend (by closed account 1v5E3TCk)
Need a quick hand
 
OK. I am trying to implement a method that removes all the prime numbers from a vector. They are all numbers from 0 to num, where num in given by the user. ...
[6 replies] Last: Make it two pass First mark all the elements to be eliminated (by inst... (by ne555)
C++ Explicit specialization question
 
#include <iostream> #include <typeinfo> #include <cstring> using namespace std; struct student { int age; }; template <typename T1, typename T...
[3 replies] Last: don't, overload instead. For your second example template <typename... (by ne555)
Pseudocode
 
Hi guys I need help with some pseudocode and I already have some lines I think. Write a program that prompts the user to enter an item#, the program should ...
[1 reply] : Starting from where you left off...(it's up to you to make sure what y... (by ENIGMAx)
classes n file handling
 
facing errors:why am i facing fatal error #include <iostream> #include <fstream> #include <cstring> using namespace std; //Class StudentInfo clas...
[6 replies] Last: indentation is terrible, but it looks like you ain't put a ";" at the ... (by mutexe)
by tee360
Pointers, Dynamic Arrays & Vectors
 
I get so close, and then it seems my brain shuts down ... I need to write a program that outputs a histogram of student grades for an assignment. The program sh...
[3 replies] Last: My original code had a typo. Instead of //Create pointer int p ... (by vlad from moscow)
C::D SFML Can't link properely?
 
I use SFML 1.6. and CodeBlocks. I have done everything like in the tutorial. Why I get this linker errors if those files is in that directory. ..\..\..\lib\m...
[no replies]
by R9986
What is the output of the following program?
 
What will be the output of the program and what is the reason for this output? Write your answers in an ASCII-File #include <iostream> using namespace st...
[5 replies] Last: why only 34? i think output should be: i: 34 res: 26, val: 26 ... (by abhishekm71)
June 2013 Pages: 12345... 28
  Archived months: [may2013] [jul2013]

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