49,757 Topics

Member Avatar for
Member Avatar for meli123

I would like to make a program which allows you to enter a number (say 145). It reads the 3 CHAR and prints the largest one. I can make it to compare integers but where I am lost is how to compare characters in a single 145 (example) input so …

Member Avatar for TrustyTony
0
296
Member Avatar for wazzer225

Hello just curious, I know that i'm supposed to use new in c++ but decided to experiemnt with malloc. Can you explain to me why the following code crashes and what is the reason. I was under the impression that the size of vector is fixed as it just stores …

Member Avatar for Stefano Mtangoo
0
3K
Member Avatar for stevanity

Is there anyway to run a Java program through C/C++? (i.e.) When I run the C Program, the program must start and it must inturn run a java program and display its output... Im not talking about using Native interfaces and all. Not code interoperability. Just run the java class …

Member Avatar for stevanity
0
215
Member Avatar for whiteLT

Hello, I am new to C/C++ and I would like to make my first project something similar to torrent searcher and downloader and my first obstacle is how to add a search ability, I know how to add a "edit control" so that users can make a string what they …

Member Avatar for whiteLT
0
87
Member Avatar for meli123

[CODE]#include <iostream> using namespace std; int main() { char a, b, c, d, e, f, max; cout << "enter a b c: "; cin >> a >> b >> c >> d >> e >> f; max = a; if(b>max) max = b; if (c>max) max = c; if (d>max) …

Member Avatar for murnesty
0
207
Member Avatar for benap2

Hello all. I'm currently working on this project and I have this problem that I can't figure out. take a look at my codes and please give me some ideas. I'm kinda new to C++ by the way. thanks [CODE] #include <iostream> #include <cstdlib> #include <ctime> using namespace std ; …

Member Avatar for Dlx06
0
108
Member Avatar for Zssffssz

Ok, I have chosen my exact path in life and need to learn this: How would I program for Linux? I have only minute ammouts of windows programing so start from absalute basics (like after cout and cin and main() stuff, start at oh something like LinMain or whatever linux …

Member Avatar for Ancient Dragon
0
181
Member Avatar for Harley_Quinn

So here is my code for a sum function for a vector - using boolean success to just pretty much catch simple errors and what not However when I compile it says that success is undeclared in my int main() and I was just wondering how to properly declare it …

Member Avatar for Harley_Quinn
0
183
Member Avatar for zendet

The errors in the program say all the cases besdies the 1st ones inside the "woods" function are not within a switch statement, i think its something to do with the if statments i have inside the switches, any help to help me solve this would be great, thanks everyone. …

Member Avatar for WaltP
0
4K
Member Avatar for ThuggyWuggy

I keep getting an error saying that I am not using an object while calling a method, but I do not see how i this is the issue since I declare my class as a class... here is my code: [CODE]#ifndef __STACK_H #define __STACK_H #include <iostream> #include <cstdlib> using namespace …

Member Avatar for ThuggyWuggy
0
1K
Member Avatar for XodoX

The input is in a text file and it being read by the code and stored in "line" by using getline. The input is just math operations.. 1*8+2 etc. Only * and +, nothing else. But the file can also contain invalid strings such as "1++" "1+2*+4" "2 + A …

Member Avatar for XodoX
0
113
Member Avatar for coolbeanbob

Is this possible? I need to read the data from a stack (and a queue), but I need to maintain the stack (and queue) so they can be used later. I have not found any useful information online. My only thought is loading the data into a parallel stack before …

Member Avatar for mrnutty
0
197
Member Avatar for shwick

I have a question similar to this, [url]http://stackoverflow.com/questions/457050/how-to-display-text-in-system-tray-icon-with-win32-api[/url] I tried his solution but it's not working for me. I get a small 4x16 white image as the system icon instead of text and I can't understand why. I'm not using MFC/.NET just win32 api. [CODE] void UpdateIcon(HWND hWnd){ NOTIFYICONDATA nid; …

0
122
Member Avatar for coolbeanbob

Hello Everyone, I am working on a package delivery simulation. I believe I have a bug. Lines 47-53 give the user the option to choose a particular moment of time where they can see a snapshot of the system's status. The program seems to break down if I choose to …

Member Avatar for coolbeanbob
0
180
Member Avatar for kaeirlic

I am working on an assignment that requires me to read in a text file with text that looks like this [CODE]974 Headlight_LoBeam 6 12.87 5 3[/CODE] I am able to open the file successfully and just for testing purposes I am able to use getline() to get the first …

Member Avatar for kaeirlic
0
423
Member Avatar for coolbeanbob

Hello All, I am trying to return three integers from the load function below. Right now, the program only returns the throughput variable. How do I use this function so it returns all three? (I am trying to implement this in a larger project where I cannot call the load …

0
74
Member Avatar for aaronmk2

I am trying to get the height of a BST using a stack. I was told that I should use preorder and measure find the largest size of the stack. However, this does not seem to work. Any ideas of what I am doing wrong. [CODE] int PBT::maxDepth() { if …

Member Avatar for Taywin
0
172
Member Avatar for meli123

Ok so I played around with this for a while and it works..but I wana know the logic [CODE]#include <iostream> using namespace std; int main() { int number; int max = 0; cout << "enter number: "; cin >> number; while (number !=0) { if ((number % 10)> max) //rem …

Member Avatar for Anirudh Rb
0
264
Member Avatar for Triarius

Can somebody please tell me what am I doing wrong? I have created a so called "game" and I have decided to add some random events. That's where I got this nasty error which I do not know how to dispose of. [CODE] #ifndef FUNC_H #define FUNC_H #include <iostream> #include …

Member Avatar for Narue
0
226
Member Avatar for coolbeanbob

Hello Everyone, I am getting the following error on line 12. "variable or field 'start' declared void" I have deleted quite a bit of code, in case your wondering what the program is supposed to do. I don't understand why the compiler would have a problem with this function being …

Member Avatar for coolbeanbob
0
451
Member Avatar for king03

Can someone please explain to me how the pointers were used in the line w/ the red font. I do not understand where the pointer pertains to and why there is still a need for that. Also why is it that a "+" sign was used to combine two array …

Member Avatar for Ancient Dragon
0
133
Member Avatar for cent91

hello everyone. i read about the functions abswrite() or absread() etc, but these fucntions are not supported in modern compilers. i would like to know what are the modern alternatives of these functions in c++?? btw i am using visual studio 2010 and rad studio xe.

Member Avatar for cent91
0
319
Member Avatar for neelpulse

Hello all, I was trying this problem of checking if the input integers can be ordered using the STL implementation of the stack. The program reads from a file named "input.txt" which in its first line has the number of integers that follow in the second line. The second line …

0
161
Member Avatar for ROCK_ST@R

[CODE]#include<stdio.h> #include<conio.h> #include<stdlib.h> struct clink { int info; struct clink * next; }; struct clink * start; void create(); void display(); void main(); { [SHOWING ERROR IN THIS LINE "Declaration terminated incorrectly"] struct clink *p. *q. char ch; clrscr(); start=(struct clink *) malloc (size of(struct link)); printf("in ent the info;") …

Member Avatar for Ancient Dragon
0
97
Member Avatar for tyu1996

Hello there! I just start to learn the basic of C++ in/output functions. I wrote a program: [CODE]#include<iostream> using namespace std; int main() { int ptype; char options; char finops; do{ cout<<"Select a printer type: "; cout<<"\n1. HP printer"; cout<<"\n2. Dell printer"; cout<<"\n3. Brother printer"; cout<<"\nYour choice : "; cin>>ptype; …

Member Avatar for Ancient Dragon
0
150
Member Avatar for R3AL

I have the following code: [CODE]HWND hwn= FindWindow(NULL,"CABAL"); HDC hdc = GetDC(hwn); COLORREF x; POINT m; m.x=50; m.y=50; ScreenToClient(hwn,&m); x=gp(hdc,m.x,m.y); if(x==CLR_INVALID) cout<<"CLR_INVALID\n"; cout<<"Red: "<<(int)GetRValue(x)<<"\n"<<"Green: "<<(int)GetGValue(x)<<"\n"<<"Blue: "<<(int)GetBValue(x)<<"\n"; [/CODE] The problem is gp( GetPixel ) always returns CLR_INVALID and white (255,255,255). Also, I find it strange that SetPixel works with any coordonates. …

Member Avatar for R3AL
0
172
Member Avatar for Motifaithed

Hi Everyone, I'm new to C++ and developing something to enhance my skill, however I find it difficult on my knowledge right now, I want to write a program similar to SMS that everytime I input a character it will automatically increase my counter, and if i will press backspace, …

Member Avatar for harinath_2007
0
153
Member Avatar for existence19

SORRY I TRIED TO INDENT THE CODE BUT IT DIDNT WORK OUT I am trying to make a binary tree for conversion of postfix to infix. the binary trees class is as follows WHAT I HAVE TO DO AND WHAT I AN HAVING TROUBLE WITH 1) READ A POSTFIX EXPRESSION …

0
66
Member Avatar for rjcenteno

i have a program that reads in a file with shapes and numbers and tokenizes each line. after it tokenizes, it then calculates the shapes dimensions. what i need to do is make it so that this program reads in the file and stores every shape and its values into …

Member Avatar for rjcenteno
0
183
Member Avatar for GatorProgrammer

I am required to compute all Lucas numbers up to a certain number. To keep track of a summation, more specifically, the summation of all Lucas numbers you have encountered up to that point. A small example: If the user inputs a bound of 23: Lucas numbers up to 23 …

Member Avatar for mike_2000_17
0
166

The End.