49,761 Topics
| |
I am new to C++ and I am having problems with my code as you may imagine. As a newbie, I am creating an application in which converts celsius to fahrenheit and vice versa. The application has to ask what the user wants. I set up the application to run … | |
Hey, I have a volume/surface area calculating program, but the problem is that my program always runs through the first possible choice instead of choosing between two. It will always do the cube/rectangle function instead of going to the square pyramid function. Here's my code. [CODE] #include <iostream> #include <windows.h> … | |
[CODE] cout<<"\n\n Please Input The Drive Letter Of Your Input Device \n"; cin>>DRL; string str(DRL); string str2(":"); string src; string hi; src=str.find_last_of(DRL); cout<<src; if(src!=str2) { hi=string(DRL)+string(str2); cout<<hi; } else*/ cout<<hi; [/CODE] [What am i dong wrong.i am trying to enure a colon input in the drive letter regardless of user … | |
Hi guys. I have a php script that reads some values off a website and prints to a file every second.. The thing is, the script is always ran in my browser and I don't like that. I want to write a c++ program that can run that script within … | |
Hi, I'm trying to put together a recursive function to count number of internal nodes, but I can't seem to grasp how to just grab internals. Any help? This so far only seems to count number of nodes [CODE] int numI(Node* p) { if(p== NULL) return 0; else return 1+numI(p->left)+numI(p->right); … | |
hey guys, i have a C++ assignment and i have no idea where to start. my assignment is we have to capitalize first letter of the every word entered. if asked user to enter a their full name, the program should capitalize the first letter of their first name, middle … | |
I'm having a problem with my struct I believe. [CODE]struct GLPoint { int x; int y; }; int totalmarbles = 64; GLPoint midhold[64]; double dist(GLPoint a, GLPoint b) { double distance = sqrt(pow(a.x - b.x, 2) + pow(a.y - b.y, 2)); return distance; } void init(void) { glClearColor (1.0, 1.0, … | |
I am using _getcwd() to get the full path of the current working directory but I am having a strange problem with this: When I run the program from within Visual Studio _getcwd returns "F:\...\ProgramName\bin" to which I append "\Debug\config.txt" to give the path of a text file. However, when … | |
In my cs2 class the assignment is to implement a sparse matrix with pointers without using a 2d array. Here is the exact text: A sparse matrix can be represented using an array of pointers called "arrayOfPointer" and an array of integer called "matrixInfo". The size of "arrayOfPointer" will be … | |
Hi everyone....iam electronics engineering student and i have experienced some c++ ,i mean i know till oop basics... i want to learn scriptig language for EDA, i want to know which to learn...Perl or Python?....can python do everything perl can do??....i hear that perl is much harder to learn...is it … | |
I've been getting an error that says a class isn't declared when I try to pass it to a function. I got this error before, so I deleted the code and typed it out again and it worked. It's not working this time. The program starts in main, then goes … | |
char experiment = 'Q' is what I got, however if I were to type in "AAA" or simply more letters than one then it will bug out a bit for me. Is there some kind of similar text to this but for char: [CODE] int mainval; while(true){ cout<<"1. Start game"; … | |
I am trying to call a C++ program for a Windows Forms App and to subsequently wait until the exe finishes. So far here is what I have: [CODE] Dim ProcessID As Integer Dim ProcessHandle As Integer ProcessID = Shell(filepath_exe, AppWinStyle.NormalFocus) ' Check the Shell command worked If ProcessID <> … | |
I have a hw problem that has me baffled. Im sure It is not a big deal, i just am not that familiar with c++ yet. I am tasked with assigning a char value to rate an employee if I enter certain char's i should display a specified string. and … | |
So I'm asked to write a program that outputs the first N number of frugal numbers. A frugal number is a number that has more digits than the digits in its prime factorization (including the number of digits in the powers) Ex: 1024 = 210 1024 is frugal since it … | |
I am having hard time understanding what the problem is with my code here. Basically I have a map that contains Key objects as the key, and Block* as the value. The point of this for loop is to print out the values that the key contains on to the … | |
I am working with an array of 10 numbers and I have already read them in and printed them out. The two functions below are the ones I am having trouble with. This is what the input looks like: 3 7 9 3 8 2 10 11 4 14 Write … | |
can anyone please provide me with a clear explanation of Win32 resources? You can make a dialogbox or menu for your win32 program using either resources or using c++ to code it. 1.) Why would i ever choose to use a resource script/editor provided by my compiler vs codeing it … | |
i try to understand how it works. its supposed to work but isnt. the following code shouldnt be working?what i do wrong? i receive the constructor values. [CODE]#include "Person.h" #include <iostream> #include "fstream" #include "cstdlib" using namespace std; int main() { fstream file("malakia.dat", ios::out | ios::in | ios::binary); Person data; … | |
Hello, I'm developing an application that reads a text file, and then replaces what's in the text file with an array (alphabet) It all works ok until I try and change the position of the inputted character and it returns: [b]Segmentation fault: 11[/b] It's really confusing! Here is my code: … | |
This is the assignment: Write a class named Employee that has the following member variables: name. A string that holds the employee’s name. idNumber. An int variable that holds the employee’s ID number. department. A string that holds the name of the department where the employee works. position. A string … | |
Good morning, I've been trying with various libraries (everything from pugixml to RapidXML) but have been unable to parse a simple XML file. [b]I want to grab all the inner text of each page->text into separate std::string's.[/b], so 1 page per std::string. My RapidXML attempt: [url]https://ideone.com/XWylb[/url] My pugiXML attempt: [url]https://ideone.com/RzN6X[/url] … | |
As the title says, I need to know how to put a "Credits" or "About" tab in my form, so people know that its from me. (I made a little Halo Reach Music Player with music, I just started programming yesterday and the app is finished, it just needs the … | |
Hello guys... I had an assignment where i needed to find the average temperature.. here is the question This project asks the students to read input data from a file, do some processing, and direct the output onto the screen. Use Visual C++ to write your program. Write a C++ … | |
I cant figure out how to plug in my vectors for my High and Low. I am fairly new please Help. [CODE]#include <iostream> #include <string> #include <vector> #include <iomanip> #include "conio.h" using namespace std; //Create a datatype to represent weather station... struct SurveyInfo { string LocationID; //The location of the … | |
I have two quick questions: 1) What is the point of a static method? As far as I can tell, there is no data there that would be accessed by multiple objects as there is no data stored there at all... 2)What does it mean to have a const after … | |
If statement acting weird. For some reason if in the IF statement `if ( choosePositionX )` goes to else which tells the user the other player already made the move it goes into the next if `if ( choosePositionO )` and prints out the else in that one. How can … | |
I'm trying to make it where I can draw an square with the values in the global array. I made it work without vertex array before but now I need to save it in array so I can possibly delete a square with just a mouse click. However I can't … | |
Hello I have been trying too long for this but I think I am gonna ask for help. [CODE]#include<iostream> #include<string> #include<math.h> #include "numStack.h" #include"charStack.h" using namespace std; int getNum(int num[],int count); int addition(int n1,int n2); int subtraction(int n1, int n2); int multiplication(int n1,int n2); int division(int n1, int n2); int … | |
I need to convert a true type font into a list of three dimensional vertices using openGL. I looked at the NeHe tutorial, but it only creates a display list from the font and as far as I can tell it is not possible for me to extract the vertices … |
The End.