49,761 Topics
| |
my assignment is to figure out the output but im bot sure i got it right here is the Q A variable x globally defined in your program is assigned the integer value 3. A variable x defined in a function named f_name is assigned the integer value 5. Answer … | |
I'm trying to create a program where it reads in the high and low temperatures for each month of the year using a 2D array. However, I cannot seem to get it working correctly. It outputs a bunch of strange numbers. [code] #include <iostream> #include <iomanip> using namespace std; const … | |
I need to make a program run just one copy of it using Mutex. But I coudn't find anything on using Mutex in c++. | |
Hi! I read the clearing input buffer article on the top of the c++ forum but I don't really get it, and it doesn't work. This is my problem, I know that cin is just like a file in that it has a buffer (correct me if I'm wrong, I … | |
Hello, I am trying to test my binary tree, but I am getting errors: The error occurs when I try to call a template function. For example: tree.insertNode(inp);. I get this error: request for member âinsertNodeâ in âtreeâ, which is of non-class type âmain()::binaryTree ()()â . I have defined my … | |
Let's say you have made a class called threevector which takes stores three doubles. Then you define another class, a fourvector, which stores four doubles. I have seen this syntax used for the constructor of the fourvector: [CODE]fourvector(double fourth, threevector one_two_three): threevector (one_two_three) { fourth = 0.0; }[/CODE] I understand … | |
I am having problems accessing the members of the base class in my derived class. Is there anything wrong with the way I defined my base class as in: template <class T> class Stack : private Llist<T> Is there anything wrong with that? I am getting errors from gcc in … | |
I am trying to time the execution of a quicksort algorithm in C++ but for some reason it constantly returns 0 for me, which clearly can't be right! I don't know where I am gooing wrong, so any help would be greatly appreciated!I have the code done for arrays of … | |
hi, i have a small problem with the rand operator. at first i tried using it without srand but gave me the same value each time. i have inserted srand(time(0)); but my compiler throws me up these errors: 1>c:\users\ben\documents\university work\year 2\c++\code\myc++\spritelab\asteroidsgame.cpp(17): error C4430: missing type specifier - int assumed. Note: … | |
hello ppl i am a new member of the programming club it been a week since i begin to program and i am doing it persnaly so i am sorry if what i posted is stupid but i want u u guys to have a look and tell me whats … | |
Hi friends, I was trying out some inheritance related stuff and found something. I just want to know the reason why. I have a ParentClass and a ChildClass. Both have an integer named [B]commonVar1[/B]. Also both have a getter method of the same name. Here goes the code. [CODE]class ParentClassOT … | |
I'm working on a program using heaps and I have a few errors that I can't quite figure out. The first is error C2143: syntax error : missing ';' before 'using' line 2 and the second is error C2011: 'Heap' : 'class' type redefinition line 8 [CODE]#include <iostream> using namespace … | |
i want a program to remove on;ly excess of spaces if there are more than one spaces it should be reduce to one | |
Hi, I don't understand the need for the while statement. Any help would be greatly appreciated. [CODE]double michel() { double x, y; do // The loop computes points on the graph of y against x. { x = 53.0*rand()/RAND_MAX; // x is the momentum. x is randomly generated. Min x … | |
What free C++ programming tools do people recommend? And just to check I would be able to run my programme from this tool? | |
Hello, I'm working with a team on a program and freeglut is causing trouble for one of team members. He's the only member working under Windows and he's unable to get the scroll wheel to work. Does anyone know a library for windows that'll read in the mouse wheel input … | |
I want to write a program that asks the user to enter his date of birth and print the zodiac sign on the screen. The program should allow the user to enter his date of birth in the MM/DD/YYYY format. The program should also print the user's age on the … | |
Hello, It seems like a simple task, but I can't find a simple answer. How do you find out how much extra space you have on drive "X:\". Is there any simple command like; [ICODE]Size(X:\);[/ICODE]? Or can someone just give me a few lines of code, NOT 53! I just … | |
Hello, I have this code: [code] void GetProcId(char* ProcName) { PROCESSENTRY32 pe32; HANDLE hSnapshot = NULL; pe32.dwSize = sizeof( PROCESSENTRY32 ); hSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 ); if( Process32First( hSnapshot, &pe32 ) ) { do{ if( _stricmp( pe32.szExeFile, ProcName ) == 0 ) break; }while( Process32Next( hSnapshot, &pe32 ) ); … | |
help please... what is the use for double varilabe in dev c++.. and how do u print it on the screen? | |
| Is it possible to do that? If so,can anyone give a theory or something? Thanks :) By the way I am using turbo compiler 3.0 |
I would really want some advanced C++ programmer to answer me this question, so please help me I really need this answer. How can I really start programming with C++? Of course, I still have a lot to lean. I just learned classes and SOME of inheritance features, I write … | |
And sorry for double-posting...It's years of frustration and waiting that's compelling me to desperately get an answer here. Thanks for all who are even willing to try and help because I've asked for some tips about this on countless other sites like this and no one has actually helped. I … | |
Not really understanding the concept, why did they use "Person *pPerson = new Person("Susan Wu", 32);" and where did ".length();" come from? Also when "Rectangle *pRect" is put into a parameter, pRect is pointing at the address of the object rect, right? [CODE] #include <iostream> #include <string> using namespace std; … | |
I do not understand why the pointer addition is failing. [CODE] char *pipebuf=new char[40001]; CommandRobot *cr= (CommandRobot*)pipebuf; cr->command=2; DWORD *rooms=(DWORD*)(cr+1); *rooms=100;[/CODE] For some reason after executing the value of pipebuf only contains the value of command, it does not contain the value of 100; Yet, when I remove the new … | |
I am trying to add two numerical char arrays such as: [CODE]"124" and "589"[/CODE] I wrote functions to reverse the string and add the strings, and it works for strings like "123" and "456", but when the last digits are greater than 10, I don't know how to carry it, … | |
hello all, I am trying to make a menu driven program that uses a while loop and a switch in main. When i choose #1, the code seems to work. However when I type in #2, and enter data, the program goes into an infinite loop, because the menu is … | |
What happens when I set the value of an integer to NULL? I print it out / debug it, i get the value zero. Even I can use the NULL assigned integer to initiate another integer. Well, then what is the point of being NULL? Why set it to zero? … | |
can u help me in my assignment: [B]make a program that would display the figure as shown. use a WHILE structure and a method to implement a task.[/B] this is the one i made: please help me what are the missing codes there.. #include <iostream.h> #include <stdio.h> #include <conio.h> using … | |
I'm trying to run this program all together without it being separated into header files and cpp files. Run the program, it just says there's syntax errors. Another problem I'm getting is when the program actually runs, the second event's data arguments don't do anything at all... [CODE]#include <iostream> #include … |
The End.