49,761 Topics
| |
Before people go why would i want to create an array of size 0 - this is due to writing a test program. at the moment i have two diffeent ways of doing - not sure which one is even slightly correct 1.[CODE]uint8_t * BufferB = new uint8_t[0]; uint8_t* p; … | |
Hey all, i made a socket that accepting connection from a game , in the game u should type in username and password , i can recive it bt , it's like ummmm encrypted letteers and numbers my question is where to look at so i can understand how to … | |
I have spent all of yesterday and this morning trying to think of how to do this, and I am still stuck. I don't understand how I can take a std::vector<char> (bytes) and extract values from it by combining the bytes. I have read everything that people have posted but … | |
[CODE]class StudentMarks { public: int Marks; StudentMarks(); StudentMarks(int iMarks); char grade(); }; #include"grade.h" #include<iostream> using namespace std; StudentMarks::StudentMarks(int) { int iMarks=0; } /*StudentMark::StudentMark(int iStudentNewmark) { iStudentmark=iStudentNewmark;*/ char StudentMarks::getgrade() { if(iMarks>=80 && iMarks<=100) { return 'A'; } else if(iMarks>=75 && iMarks<80) { return 'A-'; } else if(iMarks>=70 && iMarks<75) { return … | |
which programming tool will be better if I need to write the POS system ? Thanks guy .. | |
First of all, Im not too good at c++. so please take it easy on me. I try to change the password but i only want to change a certain password in the text file.But when the text file got re-write like only one new password exits. the whole file … | |
Okay, I was given a picture in bitmap format and a very brief explanation on seekp and seekg. And was told to write a program. I am supposed to make overwrite the image as its own negative and output in binary. I don't know where to even start, I know … | |
Using C++/CLI-- Is there a good way to return a value (not a DialogResult) from a form shown as a dialog? I plan to use Invoke on a method to update the previous form from within the dialog, if not. I also would like to thank the fine members of … | |
how can i display all the account numbers that have been entered. it only shows the last account number entered, not any before it. heres the code- [code] #include <iostream> using namespace std; int main() { double deposit; double previous; double newtotal; double withdraw; int total; int number; int res; … | |
How to start using the GNU Octave libraries for Visual C++? I've read carefully the site but couldn't find any info how to start working with it in details. Especially I'm interested in this example: [url]http://www.gnu.org/software/octave/doc/interpreter/Nonlinear-Equations.html[/url] Starting from words: "Here is a complete example..." I wanna see this in C++ … | |
hi.. i'm new here i try to do bingo program in separated file but my class name is not declare.. i search on internet on how to solve it but still gives me error can some one help me??? [CODE]#ifndef BINGO_H #define BINGO_H #include<iostream> #include<stdlib.h> #include <time.h> #include <string.h> using … | |
Hello out there, I am trying to compile some simple code but am running into a weird error that I can not figure out terminate called after throwing an instance of 'std::ios_base::failure' what(): basic_ios::clear Aborted This is happening when I do an Infile>> read in the code below. What I … | |
i made a bank program, it askas the users to put in their account number. it works with a while loop. i ask for the person to enter 1 to start or 0 to stop. i need help on how to display all the account numbers that were entered once … | |
I'm just learning how to use templates so I don't really have any experience with them, and I can't seem to understand what I'm supposed to do ... there's apparently an issue with the showWeaponSpecs: error C2783: 'WS AssaultRifle::showWeaponSpecs(void)' : could not deduce template argument for 'WS' : see declaration … | |
Hi, I'm trying to develop a program that will, if a condition is not met, display an error message without having to close the background window. If I use [ICODE]Application::Start[/ICODE] It returns an error saying that the only one window can be open a once blah blah blah. I'm looking … | |
When having a class: [code=cplusplus] class X { int data_; void f() { //shall I cache var data_? by doing int cached = data_ //and instead of this: if (data_ >= 0 && data_ < 1000 || data_ < 0 && data_ > -1000)//first version { //do something } else … | |
Is it a good programming practice to not use getters and setters in trivial parts of code? | |
[COde]#include <iostream.h> #include <fstream.h> #include <process.h> #include <string.h> #include <stdlib.h> #include <stdio.h> #include <ctype.h> #include <conio.h> #include <dos.h> int pass(); void abt(); void start(); int pass() { char a[750],b[500]; clrscr(); textcolor(BLUE); textbackground(LIGHTGREEN); clrscr(); cout<<"\n\n\tENTER YOUR LIBRARIAN USER NAME\n\n\t"; gets(a); if(strcmp(a,"LIBRARY001")!=0) { cout<<"\n\tSORRY FOR THE INCONVIENIENCE,YOU HAVE NO ACCESS TO THIS … | |
Am I correct assuming that a reference to an object will not call the object's destructor when the reference goes out of scope? The code I attached supports my assumption but I'm not certain if its correct...Any comments? [code] #include <iostream> class myint { public: myint():itsvalue(0) {} myint(unsigned long val):itsvalue(val) … | |
how do i include classes in my code. my lab notes say i need to include classes. [code] #include <iostream> #include <string> #include <stdlib.h> #include <cstdlib> #include <fstream> using namespace std; void login(); void Members(); void PassChange(); string inuser; string inpass; string user; string pass; string tempass; string data; string … | |
Is it possible to somehow use the winsock API on a unix machine? | |
I have the following program : [CODE] #include<iostream> #include<string> #include<conio.h> using namespace std; template <class T> class matrice { T **a; int m,n; public: matrice(); matrice(int,int,int); matrice(char *); matrice(int,int,T **); matrice(matrice &x); ~matrice(){}; template <class U> friend ostream &operator <<(ostream &,matrice<U> &); int getNrLinii(){ return m; } int getNrColoane(){ return … | |
I have a Seat Class and I'm trying to get my main file to access the Seat class and it's not working. Here is my code: My seat class: [CODE]#include<iostream> #include<iomanip> #include<string> class Seat{ public: char name; bool available; Seat(char name, bool available){ this.name=name; this.available = available; } Seat(){ name="A1"; … | |
Hi, I need help with concatenating several bits values to one big value. For example: lets say I have these char variables which I want to concatenate to one value. [code] unsigned char x = 0x02; //00000010 unsigned char y = 0x01; //00000001 unsigned char z = 0x03; //00000011[/CODE] and … | |
I am trying to create a windows form using visual c++. I type the variable value in the text box in windows and read it in by clicking a button. The variable is now stored in the form1.h header file. I want to use that variable in the my_proj.cpp code, … | |
I am having issues with the compiler in checking to see if a piece of a string is empty or not. I have a feeling this is simple, but today has not been my day with this code, but I am still doing my best. Ty tableRow is a std::vector<std::string> … | |
I am currently taking C++ but i am also in Software engineering. for my software engineering class we have to create a project(of our own choosing) coding included by April. my question is how would i use c++ to create a rigorous/simple software.... i want to do something pertaining to … | |
i gave the copy constructor in the below code just to know when will it be called.. [CODE] #include<iostream> using namespace std; class counter { int val; public: ~counter() { cout<<"destructor"<<endl; } counter(counter&) { cout<<"copy constructor called"<<endl; } counter():val(0) {} counter& operator++() { ++val; *this; } int getval() { return … | |
Hello , i was doing an exercise in book which asked to draw a diamond shape by displaying '*' using nested for loops. It took me quite a while to come up with a way to reverse the pyramid , and complete this exercise. So i was hoping some one … | |
Hi, I'm very new to C++ and am trying to write a class to model affine transformations. I have written code for a 3x3 matrix and am now trying to write code for multiplying it by (x,y,z) where z=1. My problem is I can't return the two values for the … |
The End.