49,761 Topics
| |
I get the following errors on the line with "static const string ...": [CODE] error C2059: syntax error : '{' error C2334: unexpected token(s) preceding '{'; skipping apparent function body[/CODE] when trying to compile something like this: [CODE] #ifndef TEST_H #define TEST_H #include <string> using namespace std; class Test { … | |
Hey guys , im having a problem in starting a project. Basically , i am suppose read from a file(Data.txt) and then display the information in that file in a new format. Data.txt HIstory M123 Maths M103 Science M111 English M105 As the results needs to be displayed based on … | |
Hi i am hacking a pong game into a racing game. At the moment i am trying to blit to a half screen with player A on th right and B on the left. any one know why it isn't working? I am using Visual C++. [code]/* Pony Pong #include … | |
Hi there, I have this cube which i rotate around a centre, I'm attempting to make it register when i move a sphere beyond it's x,y,z position. However the cubes x,y,z position seems to be it's origin of rotation and not it's actual current position. I believe this is because … | |
user enters up to 20 charachters that are of digits 1-9 so enter a number: 109832032 i need to get each charachter and convert it to an int. so '1''2'''3''4'=1234 how do i convert it, im using arrays and a ton of if statements, but its not working check my … | |
Hi there, I have an OpenGL scene containing a circular plane, ball and box. I'm attempting to set up bounding box's around each for a primative form of collision detection. I am trying to follow a tutorial from here: [URL="http://www.morrowland.com/apron/article/gl/boundingbox/index.php"]http://www.morrowland.com/apron/article/gl/boundingbox/index.php[/URL] But it says i should use TVector3 ... i have … | |
my code will read in a file and put the integers in the file into the array. It reads in and displays the integers perfectly, but i am stuck on how to find the factors of each number in the array. when i use my code i get the error: … | |
i have been trying to debug this program for about 2 days(not the whole days, just when ive been coding) and i still cant find the source of this bug. i have been trying to create a class factory system for a game that i want to make. first, let … | |
I cant figure out how to finish this assigment =\ Help >.< Hm.. Sry for the other language used in it =\ This is the language we are being taugh in >.<' Cik skaitlu ivadiisiet? = How many numbers to enter? Ievadiet skaitlus = entered numbers Ievadiitais masiivs = entered … | |
Can someone tell me why my code is not writing to a data file! I get no errors and everything looks great! [code] #include "Account.h" #include <iostream> #include <fstream> #include <cstdlib> // for exit function using std::ofstream; int main() { ofstream outdata; const int SIZE = 6; //Account array Account … | |
Basically, here is what the program is supposed to do: 1. Create a ResistorClass overloaded assignment (=) operator function which shall do the following: * Overload the assignment operator ( = ) to assign all m_dptrRes data values of an object of class ResistorClass to another object of class ResistorClass. … | |
There's mountains of guides for learning C++ and they all cover from hello world to pointers, but I never see any of them make a peep about making an actual window. They all stay in consoles and that's that. Why is this? Do most people never mess with API and … | |
[B]Hi friends..I had written a program on solving sudoku in 'C'..But it is not running...My logic is correct..I think that problem is in [I][U]solve[/U][/I] or [I][U]check[/U][/I] function..Plz check my program..it will take few minutes..n plz tell me what is wrong in program?? my id: <email nipped> Thx friends..[/B] [CODE]/*PROGRAM FOR … | |
What makes pointers different to normal variables, and what is the point of using them over normal variables? I want a long and detailed description please :D | |
i want to assign a integer of 100 digit length to a object. like class hugeint { /// }; void main() { hugeint a,b,c; a=10000000000000000000000000000000....100; b=20; c=a+b; } can any buddy suggest me any simple idea to achieve this.. | |
error C2297: '>>' : illegal, right operand has type 'void' error C2296: '>>' : illegal, left operand has type 'float' error C2297: '>>' : illegal, right operand has type 'void' warning C4552: '>>' : operator has no effect; expected operator with side-effect. i get these errors and i dont know … | |
Hey guys! I have my code wrote and when I run it, the code gets all the way to this point [code] //Delete Account 333411 cout << "Here you will delete the account 333411: \n\n"; AccountVector.erase (AccountVector.begin()+2); //Print the details of the vector for (int i = 0; i < … | |
hi. 2 all anyone can tell what is the wrong with this code? the result of this program is : cos(60)=-0.952413 sin(60)=-0.304811 [code]#include <iostream.h> #include <math.h> main() { float x,y,z; y=cos(60); z=sin(60); cout<<"cos(60)="<<y<<endl; cout<<"sin(60)="<<z<<endl; }[/code] cheers | |
i have to creat a program that verifes a valid user id before printing out the new email address. here are my errors: [CODE]c:\users\rena0514\documents\visual studio 2005\projects\user_id\user_id\verification.cpp(50) : error C2664: 'strncpy' : cannot convert parameter 2 from 'std::string' to 'const char *' 1> No user-defined-conversion operator available that can perform this … | |
[code]#include <iostream> using namespace std; #include <iomanip> #include <string> int main() { string name; string number; double bonusContributed; const int FW = 10; double const ticketPrice = 5; int ticketsSold; double revenuePercentage; double moneyDistributed; double revenueGenerated, adminDeduction, balanceRaised; cout << "How many tickets were sold? "; cin >> ticketsSold; cin.ignore(); … | |
I'm very new to C++, my midterm is requiring me to read from a txt file I created line by line. Each line has different subject code that requires some calculations. My understanding was that you open your file and read in the first line in the file, thats the … | |
Hello, I am getting a linking error, and I'm not sure what its referring to. Here is the error 1>Main.obj : error LNK2019: unresolved external symbol "public: void __thiscall BinaryHeap,class std::allocator > >,class Comp,class std::allocator > > >::insert(class Item,class std::allocator > > const &)" (?insert@?$BinaryHeap@V?$Item@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@@V?$Comp@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@@@@QAEXABV?$Item@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@@@Z) referenced in function "public: void … | |
[CODE]#include <iostream.h> #include <fstream.h> #include <stdlib.h> #include <string> using namespace std; //const int MAX_SIZE = 10; //char determine_grade(int smarks); class student{ public: student(); //constructor ~student(); //destructor //char grade; //set values void set_mark(int); void set_id(string); void print_students_records(student, int); //get values int get_mark(); string get_id(); private: int mark; string id; }; //void … | |
I cannot figure this out. Can anyone see what is causing the problem? This is the error I get when I try to compile with the GNU compiler: sortQS.h: In function âvoid sort(UList<U>&) [with U = int]â: test.cpp:13: instantiated from here sortQS.h:16: error: ârecQSâ was not declared in this scope … | |
Hey!! I gotten the hang of C programming, logic design n all.. But am having real trouble understanding C++ concepts... My sems are up in a month! Any suggestions on how do i get it done before that??? | |
Does the array fine but when it does the function it wont work, if anyone can help that would be great! [CODE]#include <iostream> using namespace std; void reverse(int a[10], int size) { for (int j=0; j<size/2; j++) { int temp = a[j]; a[j] = a[size-j-1]; a[size-j-1] = temp; } return; … | |
Okay so I have been trying to get this program to work for a long time. Basically it reads a text file then populates a structure that is designed to point to the four locations around that object: up, down, left and right. I believe I have the program figured … | |
Hey guys I am trying to work on some linked list stuff and I have my code put together but I wanted to post it on here and just check to make sure I am going in the right direction. Here is what I am trying to do: Create a … | |
| |
I am trying to decide how best to implement a recursive quicksort on a vector. I know that I want to swap the first and middle elements of the vector and use the value in the first position as the pivot after the swap. After that, I have some questions … |
The End.