Beginners - February 2012 (Page 21)

Help me understand this c++ program.
 
/*Program to find GCD and LCM of given two numbers*/ #include<iostream.h> #include<conio.h> int gcd(int m,int n) {while(m!=n) {if(m>n) m=m-n; else n=n-m; } retu...
[1 reply] : use code tags! this is not readable /*Program to find GCD and LCM of... (by Jikax)
by mrkhn
Individual rows Clistctrl background color
 
Hi all, Visual studio 2008 OS: XP C++ MFC. I'm trying while focusing an item from my clistctrl search in the whole list if there are items related to...
[4 replies] Last: Thanks, at the end with customdraw I was able to do it Regards (by mrkhn)
by iamIT
Guys can you help me with this one..:[ display,insert,delete node using pointer
 
guys my display and delete has an error sorry if i`m too dumb for this one..can somebody help me please! Godbless and thank you in advance to those will try to ...
[1 reply] : 2 crashes because of this if(first == NULL) { cout<<"\nYour list is e... (by coder777)
SINGLY LINKED LIST
 
can someone please help me to create a simple c++ program: linked list that will insert a node and sort it then display struct Node{ int data; Node *...
[1 reply] : i hope it help struct Node { int data; Node *link; }; void m... (by iamIT)
by ravar
linker error to static variables?
 
i defined a class like this in the header class sortAlgorithm { public: static void bubblesort(dataSorter container); static void mergesort(dataSort...
[3 replies] Last: thank you, that solved the issue (by ravar)
by atjm88
1-10/1-12??
 
#include <iostream> #include <iomanip> #include <conio> int main() { int j; cout<<"\n\t Multiplication Tables"; cout<<"\n ___________________...
[4 replies] Last: Actually just now I'm trying to change the inner loop to "for loop" an... (by atjm88)
by atjm88
floor???
 
#include <iostream> #include <iomanip> #include <conio> int main() { double x=781.2856789; cout<<setiosflags(ios::showpoint|ios::fixed); cout...
[3 replies] Last: Thanks... May I know what is this for cout<<setiosflags(ios::show... (by atjm88)
use of destructors
 
Hi all, I am not sure if I get this example in the right way: // example on constructors and destructors #include <iostream> using namespace std; class CRec...
[9 replies] Last: Those are the function declarations. It doesn't matter that the appea... (by HomesickAlien)
Bare Minimum Add/Sub Calculator
 
I am trying to make a BARE MINIMUM add and subtract ONLY calculator that compiles directly into machine code, no .NET or anything. I am using wxDev-C++ so I hop...
[1 reply] : For windows you can use Sleep(milliseconds); for pause. See http://msd... (by coder777)
character counting
 
Hi, anyone can help on it? i am using mac,Xcode to run the very simple code as below, but it shows nothing? why? did i miss anything? would it be different i...
[3 replies] Last: You're not listening. Take your code: int main () { double nc... (by hamsterman)
Robot
 
Hallo people. My team is building a robot. We have a problem with the programmering. This is out code: #include "mbed.h" I2C i2c(p9, p10); // sd...
[1 reply] : Is it possible that cmd = 0x0; addresses the first motor and cmd ... (by coder777)
Introducing a variable length
 
First I had //Stack.h ... const int LEN = 80 ; class Stack { public: ... private: ... double s ; ...; Which worked, but when I tried ...
[6 replies] Last: I think Moschops already gave you the answer. Is the 'new' in your con... (by Gaminic)
Linked List full of arrays
 
I want to make a Linked List containing arrays of size 26. In my .h file I declare it as this: list <string*> root; How would I initialize/do things with ...
[2 replies] Last: tnx for the info (by maycekelly)
by pooshi
Calculate how long a program took to run?
 
Hello All. I have this simple program here and I want to know how long it took run. Would I use system clock or something out of the time.h? #include <ios...
[7 replies] Last: That took a surprisingly long time to run. It must be the output funct... (by roberts)
by Ch1156
Vectors, Error testing help
 
I have a vector that has the user enter student marks, but if you dont enter a float it will screw up, im trying to make it so that if you enter anything other ...
[1 reply] : This has nothing to do with vector. See http://www.cplusplus.com/artic... (by hamsterman)
Problems with Templates and User defined classes
 
First, Let me introduce myself. I've been lurking on this forum for some time now and have found a plentitude of awesome resources to help me as I work in C...
[4 replies] Last: it is best to avoid the using namespace std; directive in a header f... (by Alrededor)
Numerous undeclared indentifer found in header file for one identifer, why?
 
Hello, pros: I got frustrated why my identifier is unidentified...or is there some other structural issue? Due in 1 day, would be appreciated if can help me...
[5 replies] Last: in democlass.h put the following line (outside of any class definition... (by cire)
Help with not using the goto statement
 
Hi guys. I'm quite new to c++, and have just written a code that has a few nested loops. To get out of the loops, I'm using the goto statement to get out of the...
[6 replies] Last: Ugh. Somehow I missed that those first two were nested in for loops. ... (by cire)
Why does this program close when only one of the parameters is met?
 
I wrote this program for an assignment last week. I did a little extra for my own amusement and understanding and had the program calculate negative powers as ...
[4 replies] Last: That made it click. Thank you. (by archangel95)
C++ setfillstyle problem? Help I am newbie....
 
What is the different between these two codes? Why a) shows color and b) doesn't shows color? a) // Directives: #include <cmath> #include <cstdlib> #incl...
[1 reply] : indent your code and and use the code tag for codes [<>] on the right ... (by oonej)
February 2012 Pages: 1... 1920212223... 64
  Archived months: [jan2012] [mar2012]

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