49,761 Topics
| |
i got errors hello.cpp:27: error: expected primary-expression before ??token hello.cpp:29: error: expected primary-expression before ??token hello.cpp:31: error: expected primary-expression before ??token what's wrong!? help me!![code]#include <iostream> #include <iomanip> #include <cmath> #include <fstream> using namespace std; void minMax(const double [], int, double&, double&); void numMeasures(const double [], int, double&, double&); void … | |
Anyway It seems to work fine it allocates space for everything.. But it does not put the value in. I have tested the value one statement before it is passed as an argument to the function and yet when I test it afterwards all the values are zero. So I … | |
I'm trying to write a function that accepts two type double parameters. The function is suppose to be calculate and return a base number raised to an exponent (using recursion), but I can't use the pow() function itself. I've got it working fine without using decimal format numbers, but i'm … | |
Ok so, I'm new to allegro, and I'm trying to write my first Allegro problem. It's supposed to be one of those sliding puzzles with the one missing piece and you make the picture. My program worked fine when I was just outputting the background and the picture of the … | |
Hello, I have been having a problem with the following code: [code] #include<iostream> #include<time.h> #include<iomanip> using namespace std; int main() { float average; setprecision(5); fixed; average = 100-((25/(130-(50-(130/3))))*100); cout << average << "\n\n"; } [/code] I cannot seem to get the 'average' variable to come out to exactly 79.73 like … | |
What stupid basic thing am I missing? we are to read in from a file that contains 10 lines.....name, age, etc....I can read in the file ok and print out the first line....I am having problems printing subsequent lines....HELP!! lol [CODE]//Acme Personel Report //by PAtrick Nealey #include <iostream> #include <iomanip> … | |
i know it is a lot to read..... and i have different variables to compare win - the gameboard play itself and an undeclared plr, i did that because i'm not sure what and how it should be used there (so i expected those errors), b4 i added in the … | |
Hi, having a variable like this: [CODE] vector<Object*>* foo; [/CODE] does [CODE]delete foo;[/CODE] deallocate the memory occupied by the various Objects or does it deallocate only the vector container? | |
hi guys, i'm having a bit of a prolem with C++, i've been programming c# for quite a while now, so i am not a novice lol. problem -- i've created the following ofstream in my main method: [CODE]ofstream out1("array1.txt");[/CODE] however later on in the code i call [CODE]out1 << … | |
help me~~~ what's wrong with it?![code]#include <iostream> #include <iomanip> #include <cmath> #include <fstream> using namespace std; void minMax(const double, int, double&, double&); void numMeasures(const double, int, double&, double&); void getData(fstream&, double, int&); int main() { double count, min, max, mean, var; double data[400]; count = 25; /* how can I … | |
Add a third box to the calculation. Calculate length (L), width (W), and height (H) for the third box. Calculate the total volume for all three boxes in question. I have gotten this far but i am unable to fig out how the proper syntax should be for this. Here … | |
[CODE]class C_Class { public: struct _Get { void foo( void ) { m_Var = 0; } }Get; struct _Set { }Set; long m_Var; };[/CODE] I like to organize my functions with get and set structures [CODE] Get.ThisThing(); Set.ThisThing();[/CODE] But my structure's functions cant access the classes members unless I make … | |
Hi, I'm new to C++. I'm having trouble detecting space bar as an input. I'm unfamiliar with using the char data type. I've tried using ASCII decimal numbers but only detects the '.' . And I'm unsure how to go about this without using string or anything advanced. [CODE] char … | |
I am in need of a physics engine for my game. I know that there are already physics engines out there, but I want to create my own from scratch. It's nothing more then knowing the formulas and how to implement them right? What I am asking for is what … | |
How do I truncate double like 99.998765 to something like 99.99 instead of 100.00? If some printf("%.2f", myDouble); gives 100 That is not what I want. Any help is appreciated | |
I am a noob in programming and i am writing a program in Visual C++ and i want to save a screenshot taken when the program opens to a .bmp or some type of image file. keybd_event(0x2C, 0, 0, 0); I am using this to call the keyboard event PRTSC, … | |
Hi guys, When I run this code, I got segmentation fault and i can't figure out where the mistake is? I'd really appreciate any help. thanks [code] #include <fstream> #include <iostream> #include <string> #include <sstream> using namespace std; int main () { ifstream file, dest; file.open ("arp.txt"); if (!file) { … | |
Hi all, I'm trying to capture an event when tab is pressed in a textbox using visual studio.net, and am having a hard time. I can capture anything else, inluding the keys that are difficult like instert, alt, and the arrow keys. Here is the MSDN page that did not … | |
Hello, How to get information about type of file which does not have extension. If I have folder named as [ABC] and also file name same as [ABC] without any extension. I am using FindFirstFile() function to get folder information. [CODE]char path[3] ="C:\ABC" HANDLE hFind; WIN32_FIND_DATA FindFileData; hFind = FindFirstFile(path, … | |
I need to get characters one at a time from an ofstream because I need to pass the characters into a function. This is what I was trying but it says "ofstream has no member named get". Here is the code I am using. [CODE] ofstream outFile("source.txt", ios::out); a1.prepare(inFile2, outFile); … | |
Hello.. I want to know how to create a child frame within the existing main frame... when I just click a button i like to open a new frame.. I m using Visual Studio 2008 Experss Edition... As i m beginner to this vc++... Please help me resolving problem Thanks … | |
I am making a racing game and am trying to find a way to let some one 'win' the game. in order to do this I am trying to display and image on the background at a certain position. This image isn't visable on the screen though until the racer … | |
Hello All, I need some C/C++ code/calls to unzip a zip file. Please share the code/guidence. Thanks in advance, Hafeez Shaik. | |
is there any difficulties of sorting parallel arrays?if there then what are those | |
Can we make a random choose from a alphas chars ? [CODE] srand(time(NULL)); rand()%z // from A to z // Sure wrong wiz errors .. //so which way i can use ? Converting to Assci Code and choose // randomly form the Numbers which are from 65 to 90 ?? … | |
So I have to connect to a server on a specific port but all I have to identify the server is its name, e.g. "students.ce.sinclair.edu" in a char*. How can I get the ip address to assign to a sockaddr_in? [CODE]struct sockaddr_in server; memset($server, 0, sizeof(server)); server.sin_family = AF_INET; //server.sin_addr.s_addr … | |
My assignment is as follows... Create a program called part4.cpp containing a recursive function that accepts a pointer to a null-terminated string as its argument, and prints the string in reverse order. Demonstrate the function by calling it from the main function with a string that has been provided by … | |
[CODE]#include <iostream> using namespace std; class Person { private: string name; public: Person(); Person(string the_name); string get_name() const; }; //////////////////////////////////////////////////////////////// class vehicle { protected: string name; int cylinders; Person owner; public: vehicle(); vehicle(string _name, int _cylinders, Person _owner); void display() { cout << name; cout << cylinders; cout << owner.get_name(); … | |
i'm having trouble with my factors function. I need to find the factors of all positive numbers in an array and then find their sums. I'm pretty confused at this point. The last thing that I tried was to take each number in array one at a time and find … | |
I am trying to construct a linked list that contains string pointers. Since strings can be quite large, I am trying to save space and access time by storing pointers to them in the linked list. The strings are read from a text file and inserted into a linked list. … |
The End.