Beginners - March 2012 (Page 50)

by atjm88
#include <windows.h>
 
#include <windows.h> int WINAPI WinMain(HINSTANCE hInstace,HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) { MessageBox(NULL, TEXT("Hello World"),...
[2 replies] Last: Is that means every time I want to start wrting this WINAPI program, I... (by atjm88)
by ctest
How to solve this problem
 
#include <iostream> #include <string> using namespace std ; int main () { string s = "wish for my luck" , e= "thanks" , f ; int x , n ; cout<<s<<endl; ...
[4 replies] Last: thanks it's work, sorry for noob question I'm a newbie (by ctest)
by Ch1156
Help with Struct
 
I am making a program that asks the user for some info and i have my things stored in a struct, but when i go to use it in cin >> it gives me errors. Here is my...
[4 replies] Last: Awesome, thanks :) (by Ch1156)
creating graph?
 
Hi guys. I have a mx2^m two-dimensional array. Each line has 'm' character. Like this: (Here 3x8) 000 001 010 011 100 101 110 111 I want to create a graph. the...
[2 replies] Last: under Windows, you can use 'gdiplus' or standard 'gdi' functions to dr... (by Vins3Xtreme)
Switch Case
 
helo int ch do { cout<<"\n ENter your choice"; cout<<"\n 1 2 3"; cin>> ch; switch(ch) { case 1: cout<<"One"; break; case 2: cout<<"two"; break;...
[13 replies] Last: You'll have to be more specific. I'm not going to rephrase all that pa... (by hamsterman)
Moving stream pointer to next line in file
 
Is there a way to move the position without reading the line? I want to just read the first char on the line, and if it is not the one i want it moves onto the ...
[7 replies] Last: ifstream can only do input operations, meaning it can work with files ... (by LB)
by CyberX
C++ Beginner Program Fix it right?
 
#include <iostream> #include <conio.h> #include <iomanip> #include <cmath> using namespace std; int getTestScores(); double calcAverage(double average, double ...
[4 replies] Last: As vin already pointed out, you told the compiler that calcAverage() ... (by closed account zb0S216C)
Recursion Question
 
I have the below start on an issue and am looking for some guidance if you please. I am attempting to count the number of negatives in an array. te...
[4 replies] Last: if(N==0) return 0; return (a <0) + countNegatives(a+1, N-1); //or wi... (by ne555)
by Lio
Operator on power overload
 
Hi ,I am trying to overload ^ operator,is my code right and how do you call this operator from the main Thanks objA& operator^(objA &o,int power) { ...
[14 replies] Last: here's an example of powering any type: #include <cmath> using name... (by viliml)
keeping relation while sorting arrays
 
Hi, I have a array of 2 d of name ( grrr caracters) and a array of distance ( int )related to the name. ex Atown 20 Btown 34 ... .. so i know that ...
[1 reply] : I'm not entirely sure what you're asking, but if you want to enforce a... (by Gaminic)
by dpan
Trouble declaring string member in class header file
 
My compiler keeps generating an error message when I try to declare a string member in a class declaration. I've tried including <string> in both the .cpp and t...
[3 replies] Last: [quote=dpan]Hmmm, ok, that fixes it. I guess I just figured that havin... (by guestgulkan)
Compiling for 64-bit, but I get 32-bit datatypes?
 
I am trying to get my compiler to compile 64-bit code, but when I do a simple compilation of "cout << sizeof(<datatypes>)" with g++ -Wall -m64 -o test test...
[3 replies] Last: ... The C language is one of the most widespread languages and it is s... (by Andrew2011)
Question About Defining Objects in Class Headers
 
I am attempting to do something fairly complicated, so I'll boil it down to the bare elements here. Essentially, I am writing a program that creates an ellipse...
[16 replies] Last: That does it! (I decided to make it a pure virtual function.) Thank ... (by skyline01)
Unit testing
 
I am trying to test my string <= and this is my test: // String Test Program // // Tests: Less then or equal // #include "string.h" #include <casse...
[2 replies] Last: Ooof, did not even think of that, but you are right. Thank you. (by closed account GL1Rko23)
Initializing a file
 
I keep geting this errer, but I thought I was initializing it. Run-Time Check Failure #3 - The variable 'file' is being used without being initialized. if...
[2 replies] Last: Thanks. (by snipslog)
Strange behavior (Solved: srand() called more than once)
 
Hi everyone, first post. I had a years worth of C++ classes over 10 years ago, but I've used this site over the last year or so, and refreshed all that I learne...
[2 replies] Last: Amazing! THANK YOU! That did it. (by theothermii)
Is the "const" specifier necessary? Any benefit?
 
#include <iostream> using namespace std; void printBinary(const unsigned char val) { for(int i = 7; i >= 0; i--) if(val&(1 << i)) ...
[2 replies] Last: Thanks for your elaboration, which is helpful. I appreciate it. (by foxatlarge)
list<>::const_iterator with list.remove()?
 
Can values in a list be removed if using a conatant iterator? for ( list<string>::const_iterator Iter = names.cbegin(); Iter != names.cend(); Iter++ ) { nam...
[3 replies] Last: I can't use list::clear because I am only removing certain data from ... (by Cubbi)
Help with c++ grade calculator
 
Hello guys, This is my first time posting on this forum and i hope i can get help. I need to get the sum of the grades entered and take the sum, divide it...
[6 replies] Last: ok...the problem that i'm facing is it is not calculating the sum of t... (by ahad917)
Need help with C++ program please help!
 
Need help with C++ program please help!? I'm having problems with this program, if you run it more than one time the hst total is way wrong! Can someone please...
[1 reply] : Please indent your code. ¿Could you provide a minimal example? (witho... (by ne555)
March 2012 Pages: 1... 4849505152... 71
  Archived months: [feb2012] [apr2012]

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