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

by grima
Difference between "->" and "." in C
 
Hi everyone, If one have defined a new typedef struct in C, the members of this new struct will be accessed by "->" or "." in C? I've read something abou...
[1 reply] : They access members of the struct. If you just have an struct instance... (by Zhuge)
Columns
 
Hi! I'm working with arrays and I get them column by column and need to print them. I as there a way to print in columns? for example: I produce an array of ...
[1 reply] : I'm working with arrays and I get them column by column and need to ... (by buffbill)
Can somebody please help with c++ code on arrays!
 
I am trying to write a program that keeps track of social security numbers of customers I have to assume that its a four-digit number. When the program runs,it ...
[3 replies] Last: Your program is suffering from an acute case of malnutrition. Main() h... (by buffbill)
Problems with rand() and srand()
 
Hello there. I'm in the process of writing a tick tac toe program. The game isn't finished, but it's completed enough that I've found a substantial error with t...
[4 replies] Last: Got it. Thanks all! (by Nathan Justice)
switch statement
 
#include <strings.h> #include <iostream> using namespace std; int main(){ bool ben; ben = true; while(ben == true){ int benslastname; ...
[1 reply] : you can try this #include <strings.h> #include <iostream> using name... (by closed account 1v5E3TCk)
by tee360
Vector Swap?
 
I need help writing a sorting function that has an argument for a vector of ints rather than an array; it should use a selection sort algorithm. Here is what...
[7 replies] Last: In fact, you were using std::swap all along. The name of your swap ... (by cire)
Codeblocks C++
 
Hi I'm wondering if I can get help with some C++. Create an application that will allow a project manager to list tasks and team members on a project, alloca...
[4 replies] Last: Also, you're wanting to get input from the user. An effective user-... (by ENIGMAx)
by BToven
drumpad sounds
 
hi,im making a drumpad program so if somebody could tell me from where to get the sounds.
[5 replies] Last: you can get some cool SFX on bfxr http://www.bfxr.net/ (by NSharbz)
program efficiency if/elseif
 
C++ noob here, my program works, but how can i make it MUCH less redundant and inefficient? #include <iostream> #include <iomanip> using namespace ...
[3 replies] Last: You're still adding a redundant "reverse" conditional here: if ... (by Disch)
Doubt about Files
 
Hello, i was wondering if ofstream, ifstream and fstream are for writing, reading, and writing and reading purposes respectively, for what are the tags ios::in,...
[2 replies] Last: There's a little hint in the name of each of those streams. i = input... (by ENIGMAx)
Elements
 
#include<iostream> #include<algorithm> #include<cstring> #include<vector> #define MAX 50 using namespace std; int main() { void remove(char , cha...
[3 replies] Last: from http://www.cplusplus.com/reference/string/string/ operator+= ... (by ENIGMAx)
using string to update array
 
#include <iostream> #include <iomanip> #include <string> #include <cctype> using namespace std; int Superior ={0}; int Economy ={0}; const int srow= 4 , sc...
[2 replies] Last: Can you specify any errors that are occurring or conceptual issues you... (by ENIGMAx)
Header files?
 
Another questions. With regards to header files? Lets say I have a header file 'add.h' . Can it contain multiple includes all in the same file. eg below....
[5 replies] Last: > http://stackoverflow.com/questions/1653958/why-are-ifndef-and-define... (by ne555)
by qingze
How to generate real random number from normal distribution
 
I want to generate random numbers of normal distribution and use scentence like std::default_random_engine generator; std::normal_distribution<double>...
[2 replies] Last: But I find that each time the array I got are the same. That's becau... (by andywestken)
win32 API listbox SendMessage not working
 
Hi I have a problem with SendMessage. Anything I send doesn't show up but instead empty lines appear. What is wrong with my code? LRESULT CALLBACK WndProc(...
[7 replies] Last: Finally got it in a quite roundabout way: first I converted it to wstr... (by Bosskardo)
Making a namespace C++
 
Would anyone be able to tell me where the namespace goes when you create a namespace. I know how it works I'm just not clear where the namespace is placed. Is...
[4 replies] Last: You're welcome! (by MikeyBoy)
boolean flag !!
 
Hi,please tell me whats the purpose of bool flag given in following code as I am not able to understand being new to C++. void display_sp(int n) { student...
[6 replies] Last: ok...that explains everything....thanks MikeyBoy and iHutch .... (by RishiNagrath)
by R9986
Call-by-reference
 
This program is sorting a randomized array of integers using the bubblesort algorithm. I am trying to modify n correct the source code,so that the swapping o...
[1 reply] : I am not typing this again. http://www.cplusplus.com/forum/general/10... (by Script Coder)
by PavDub
Is this pointer arithmetics safe?
 
Hi, I hope my problem is well apparent from the (simplified example) code below... // by safeness I mean "working well at any std-compliant compiler" Thanks ...
[11 replies] Last: Well guys, we are getting a bit OT ... So to summarize: Question : ... (by PavDub)
If / else if loop
 
#include <iostream> #include <string> #include <iomanip> using namespace std; int main () { //calculates a person's regular pay as well as overtime ...
[2 replies] Last: Please use code tags next time (use the <> button). if (answer = "ye... (by Branflakes91093)
June 2013 Pages: 123456... 28
  Archived months: [may2013] [jul2013]

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