49,761 Topics
| |
So I have this code that has a sum function that sums n elements in a vector [CODE]#include <iostream> #include <vector> // need this in order to use vectors in the program using namespace std; void computeSum (vector<int> &Vec, int howMany, int total, bool success) //the computeSum function that will … | |
Hello! I want to make a trainer (just for that not because I need to cheat at a game). I have an application made by me (Untitled1.exe......ftw!) when I press any key it makes the number from x to x++... Another program I need is when I run it to … | |
Ok, I've asked something similar before, but I still have not been able to understand this... so I just want to have a txt file with math operations in it. Basically, it's just integers multiplies and added. Nothing else. 1*5+10 10+12 Each line can contain any multiplication or addition. The … | |
I tried to test Nehe's lesson 6 project. After I copied and pasted the source code, I compiled it and got the result below; ------ Build started: Project: TugasOpenGl2, Configuration: Debug Win32 ------ Compiling... Tugas2.cpp c:\program files\microsoft sdks\windows\v6.0a\include\gl\glaux.h(17) : warning C4068: unknown pragma c:\program files\microsoft sdks\windows\v6.0a\include\gl\glaux.h(374) : warning C4068: unknown … | |
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 … | |
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 … | |
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 … | |
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 … | |
[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) … | |
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 ; … | |
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 … | |
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 … | |
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. … | |
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 … | |
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 … | |
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 … | |
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; … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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. | |
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 … | |
[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;") … | |
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; … |
The End.