49,761 Topics

Member Avatar for
Member Avatar for Joonhwa Yang

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 …

Member Avatar for thousandpimps
0
4K
Member Avatar for code zombie

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 …

Member Avatar for code zombie
0
139
Member Avatar for vmirz

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 …

Member Avatar for nezachem
0
92
Member Avatar for tabicat91

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 …

Member Avatar for tabicat91
0
70
Member Avatar for restrictment

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 …

Member Avatar for restrictment
0
86
Member Avatar for fugnut

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> …

Member Avatar for fugnut
0
179
Member Avatar for nuB

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 …

Member Avatar for nuB
1
353
Member Avatar for teomurgi

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?

Member Avatar for Fbody
0
187
Member Avatar for ryan8806

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 << …

Member Avatar for ryan8806
0
2K
Member Avatar for Joonhwa Yang

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 …

Member Avatar for Fbody
0
285
Member Avatar for summey

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 …

Member Avatar for summey
0
421
Member Avatar for VilePlecenta

[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 …

Member Avatar for Banfa
0
126
Member Avatar for john10

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 …

Member Avatar for john10
0
2K
Member Avatar for tomtetlaw

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 …

Member Avatar for jwenting
0
122
Member Avatar for Stefano Mtangoo

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

Member Avatar for Stefano Mtangoo
0
196
Member Avatar for caseyrodman86

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, …

0
89
Member Avatar for Mz3g

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) { …

Member Avatar for Mz3g
0
172
Member Avatar for tonymuilenburg

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 …

Member Avatar for tonymuilenburg
0
300
Member Avatar for Prat123

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, …

Member Avatar for Nick Evan
0
162
Member Avatar for jprogram

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); …

Member Avatar for vidit_X
0
191
Member Avatar for shrutinr

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 …

Member Avatar for chiwawa10
0
71
Member Avatar for Hidden_mistakes

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 …

Member Avatar for strmstn
0
76
Member Avatar for hafeez_sheik

Hello All, I need some C/C++ code/calls to unzip a zip file. Please share the code/guidence. Thanks in advance, Hafeez Shaik.

Member Avatar for pradip_
0
1K
Member Avatar for hurricane123

is there any difficulties of sorting parallel arrays?if there then what are those

Member Avatar for VernonDozier
-3
219
Member Avatar for Mazen_1st

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 ?? …

Member Avatar for Ancient Dragon
0
91
Member Avatar for fusi0n423

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 …

Member Avatar for abhimanipal
0
160
Member Avatar for vmirz

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 …

Member Avatar for chiwawa10
0
103
Member Avatar for moods125

[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(); …

Member Avatar for Fbody
0
101
Member Avatar for flyraf821

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 …

Member Avatar for caut_baia
0
160
Member Avatar for ms_farenheit1

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. …

Member Avatar for ms_farenheit1
0
137

The End.