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

Bubble Sort pls help
 
I have problems , I need to compare two values ​​the value entered first and the second value and make comparisons to sort the values ​​in increasing or...
[1 reply] : instead of Get...() functions left of = use the appropriate Set..... (by coder777)
[How] Write simple hash function
 
How to construct a simple hash function ? When the program executes, it will ask for your name. Type your name and it will print out a "hash code" (a number) fr...
[2 replies] Last: #include <iostream> #include <functional> int main() { std::stri... (by JLBorges)
by Cotumb
MMORPG Coding
 
Is it possible to use C++ to make a MMORPG such as RuneScape, and ROBLOX, with the graphics of COD, Halo, and Battlefield 3?
[1 reply] : No reason why you couldn't. It might not be the best tool to handle e... (by MikeyBoy)
by sxpro
Pointer to class error
 
Hi, I have an error and it says: expression must be a pointer type to class Here's my node class class node (node.h) { public: node* pNext; citizen* p...
[6 replies] Last: File node.cpp shall include header citizen.h that to know the definiti... (by vlad from moscow)
URGENT - Controlled Read and Write rates of files
 
need to create a program for the following problem 1. Program takes messages as input at a rate “X” msg/sec, and outputs those messages at “Y” mgs/se...
[1 reply] : what have you got so far? (by mutexe)
Pascal's triangle
 
How can I find this equation ? Derived from where ? x = x * (i -k) / (k +1) #include <iostream> using namespace std; int main() { int n, k, i, x; ...
[1 reply] : this http://en.wikipedia.org/wiki/Binomial_coefficient will help you e... (by Maniax)
by klw
Beginner's question about matrices
 
I ultimately need to read in a binary file of unsigned ints into a matrix. The goal is to manipulate this matrix and extract a submatrix. (The binary is a 3D im...
[3 replies] Last: v is an int. &v is an int* You need static_cast<char*>(&v ) as... (by kbw)
[C] Trying to solve type conversion warning
 
I can't seem to correct a warning i get with -Wconversion (gcc) Some minimal code that displays it : unsigned char mask2=0; mask2 = (~mask2); The wa...
[2 replies] Last: That's what i'll do if i have to, but i'd have liked a soluton without... (by bartoli)
by jayw
need help with undefined and must have class struct union errors and imputing switchcase?
 
here is my code I am getting simple errors like unneeded int cin and cout undefined any help given is apprciated #include <iostream> #include <stack> #incl...
[1 reply] : std::cout << number_c << " converted to hexidecimal is: " << hex << n... (by coder777)
Building a special order of elements for a given sequence (1,2)
 
Let assume that there is an array of integer numbers in the range from 1 to N that are located in the ascending order. For example #include <iostream> #inc...
[27 replies] Last: Start iterating from the beginning. Copy first element to beginnging... (by abhishekm71)
by kaidto
Question about smart pointers. (scoped_ptr)
 
Actually I'm studying those smart pointers. But I'm having a question. Having this code, #include "stdafx.h" #include <iostream> #include <boost/sh...
[2 replies] Last: D: Ok!, it was weird, It never happened before to access a method that... (by kaidto)
Explain random number library
 
Anyone can explain this ? I just want to study the codes in deep how the integers randomize #include <cstdlib> #include <ctime> #include "random.h" /* This...
[1 reply] : This doesn't generate a random number, it just puts a bound on the ran... (by LB)
Second C++ Game!
 
Hello! Here's my second c++ game, made with SFML 2.0. It's a simple game where you have to drive a car to the end of a road. It has only 3 levels by now. Ho...
[1 reply] : Why use such a trash file hosting service? I had to make an account ju... (by Branflakes91093)
Ngram issues.
 
So I'm having an issue progressing in this program I'm trying to write for class where I have to write the implementation for it. I get what I have to do accord...
[no replies]
How to convert int to char
 
Hey, I am tying to convert an int to a char. Below is an example of the code that I have but I am getting an error('=':left operand must be l-value). I am not ...
[4 replies] Last: itoa is not defined in C++ or many compilers. Using sprintf or using t... (by ostar2)
by zmilam
Trying to figure this out.
 
I built a program that breaks down breaks and lunches while at work. However I want it to go off of a 12 hour clock. here's what I got so far; #include <cstd...
[no replies]
efficient way to draw tiles
 
Hi, I'm wondering if there is a better way to draw tiles with a transition from grass to sand. So that the tiles blend in together. My map file that i use lo...
[3 replies] Last: ahhh, your trying to make a background generator. I tried to do that o... (by TinyTeeTree)
Function not working properly
 
When i was testing a piece of a larger program, i tested this function and it doesn't work as it should. #include <iostream> #include <string> #include <cma...
[2 replies] Last: Thanks, that fixed it. (by Ghilliedrone)
The output is error, please help :((
 
#include <iostream> #include <cstdio> using namespace std; int main(){ int T, kasus = 0; scanf( "%u", &T ); while ( T-- ){ int n, m, arr , a...
[1 reply] : I think that you don't want to print "&answer" but instead "answer". A... (by ats15)
How to properly free() a _strdup variable
 
How to properly free() a _strdup variable? Here's what I have: File prof.cpp // Local function void free_proID(struct prof_Name_ID *proID); // L...
[14 replies] Last: True. Thank you. void free_proID(struct prof_Name_ID*&proID) works ... (by xwielder)
June 2013 Pages: 1... 2425262728
  Archived months: [may2013] [jul2013]

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