49,761 Topics
| |
Hi i got a problem with this code( attached below ) the fuction that receves the bidimensional array doesn't seem to work.I've tryed to cout in main() and it works.WHY???? The program doesn't show me any error whatsoever. #include<iostream> #include<string> #include<fstream> using namespace std; void afisare(int h[3][3],int nrEle){ for(int i … | |
I'm currently doing an assignment and I would like to seek for help. I'm suppose to do a creation system where Option1: I would create a binary file(outfile.dat) from infile.txt. //below is the infile.txt F Indonesian Michael Chen F France Alain Pierre S Tan Eng Soon S Lee Ang Heng … | |
please help i'm stuck on something for a project i'm doing i need to display the numbers 1 to 9 randomly but they cannot be repeated! the code i have so far is this: #include <iostream> #include <ctime> #include <cstdlib> using namespace std; int main() { srand((unsigned)time(0)); int random_integer; int … | |
Good day, I have a college project in which I need to create a program which simulates an Erlang(k) variable. I am not talking about the Erlang language, it's about a standard Gamma(0,1,k), k ϵ N+. I appreciate if someone can help me out or give me advice on how … | |
Hi,I have encountered a problem while doing the animation for my program. I wanted keep adding a another shape on top of another. But for evry second image the background changes to black. Can you point out what I've done wrong. Thanks. #include <stdlib.h> #include <stdio.h> #include <time.h> #include <GL/glut.h> … | |
#include <QApplication> #include <QLabel> #include <QVBoxLayout> #include <QTextEdit> #include <QWidget> int main (int argc, char* argv[]) { QApplication app (argc, argv); QWidget window; QLabel* label = new QLabel("Please enter some text"); QTextEdit* textEdit = new QTextEdit; QVBoxLayout* layout = new QVBoxLayout; layout->addwidget(label); layout->addwidget(textEdit); window.setLayout(layout); window.show; return app.exec(); } 1.Qt provides … | |
void doc::add_title() { doc d; fstream f; int med_lic,flag=0; char new_title[20]; cout<<"\n\t\t\tADD NEW DOCTOR TITLE\n"; cout<<"\nEnter the Doctor's medical license number :\t"; cin>>med_lic; f.open("doctors.da t", ios::binary|ios::in|ios::out); while(f.read((char*)&d,sizeof(doc))&&flag==0) { if(d.ret_med_no()==med_lic) //d is an object of class doc { cout<<"\nEnter the new title:\t";//ret_med_no() is an accessor function used to return a value … | |
This is my code so far: #include <iostream> #include <cmath> #include <cstdlib> using namespace std; int main() { float numbers[15]; float sum, lowest, highest; float min, max, range, stDev, mean, median; int indexOfMin; float above = 0, below = 0; sum = 0; for(int testNum = 0; testNum < 15; … | |
Hi, First of all, i am not trying to hack into anything or anyones e mails. I am new software engineer and I need to log into company wiki page & download info displayed into a text file or something, so i can search for data i am looking for … | |
I have a button created as follows: ~~~ HWND License; HBITMAP MainButtons; Case WM_CREATE: License = CreateWindowEx(WS_EX_TRANSPARENT, L"Button", L"License", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_BITMAP, 26, 77, 75, 23, hwnd, (HMENU)ID_LICENSE, hInst, 0); MainButtons = (HBITMAP)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_MAINBUTTONS), IMAGE_BITMAP, 0, 0, LR_SHARED); SendMessage(License, BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)MainButtons); break; ~~~ … | |
Hello, I'm having trouble with something.. I have a vector of doubles and I need to convert the vector to an unsigned char so then I can write the contents to a text file. I can do this when reading the data from a text file, just not from a … | |
Hi gueys, I am programming a class compenent liberary in C++ CLR, but I have a problem with exception throwing. this is the code that call the exception: `throw gcnew ReadStreamException(Error);` and this is the exception class: public ref class ReadStreamException : Exception { ReadStreamException(String^ Message) : Exception(Message) {} }; … | |
I meant to post this in the C forum and not the C++ forum. Below is the link to a picture of the debug error window [url]http://www.flickr.com/photos/7629837...in/photostream[/url] It's a program that i'm doing and I keep getting this error here's a link to the programming problem. Its' Number 3 [url]http://books.google.com/books?id=bSy...%2B%2B&f=false[/url] … | |
Hi guys, I have been trying to implement the A* algorithm in C++ and would like to make use of the priority_queue structure to hold the open and closed lists of nodes. The problem is, all of the algorithms that I have found use the equivalent of a "search/contains" function … | |
I have an array of data of the form: union colour { unsigned int argb; struct{ unsigned char a; unsigned char r; unsigned char g; unsigned char b; }bigendian; struct{ unsigned char b; unsigned char g; unsigned char r; unsigned char a; }littleendian; }; struct sprite { int w,h;//stores the … | |
hi guys! today i tried file writing through VC++ 2010. suddenly a point stroke in my mind to create a file which may not be read by notepad or it gives error or some wrong output as it is mostly seen on opening a pdf file in notepad. for this … | |
I'm trying to clip my Button with the following code but it does not work at all.. #pragma comment(linker,"\"/manifestdependency:type='win32' \ name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \ processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") #pragma comment(lib, "Gdiplus.lib") void RegionCloseButton(HWND hwnd) { CloseRegion = GetDC(hwnd); CloseRegionMem = CreateCompatibleDC(CloseRegion); Gdiplus::Graphics graphics(CloseRegion); Gdiplus::FontFamily fontFamily(L"Courier New"); Gdiplus::GraphicsPath path; Gdiplus::PointF Origin(5, 5); path.AddString(L"X", … | |
Hey all i am trying to write a Min Heap program using that allows insertion and deletion. I have the code for what i believe is insertion, but i am having trouble trying to figure out code to heapify and remove from the heap. If possible could anyone lend me … | |
#include <iostream> #include<string> using namespace std; struct people { string fname; string lname; void input() { cin>>people.fname>>people.lname; } void output() { cout<<people.fname<<people.lname; } }; struct birthday{ int day; int month; int year; void output() { cout<<day<<birthday.month<<birthday.year; } void input() { cin>>day>>month>>year; } }; int i; int main() { cout<<"Birthday Program"<<endl; … | |
Hey all, I've been searching Rohitab, CodeProject and various other sites to figure out how to write OPCodes to a file and cannot figure it out. I thought I'd ask here because it's the only site I have an account on and I usually get my answers here or hints. … | |
Does C++ Console apps have a TryParse equivalent.. I mean .Net has it for both C# and C++ but why does C++ Consoles NOT have this! Or am I just wrong and cannot find it? I was thinking of writing my own with templates that can be use for ANY … | |
Write pseudocode and has the following; 1. It should write the guess secret number to standard output 2. It should ask yhe user if the secret number is higher, lower or if you guessed correctly 3. It should read the answer. Repeat the question if it is not one of … | |
Hi gueys, I have question searched in google but without something that can help. **How to get the binary stream from files ( especially executable files) using winapi (CreateFile , etc)????** I learned in these days how to read write files using Createfile, ReadFile, WriteFile , etc and all these … | |
Hi, I have a problem with a the imput of some data on a program Im making (FYI new in c++, homework). So basicly the progrma I have is to imput diferent type of data, this is what im doing. (Im using codeblock 8.02 in Ubuntu 10.04 ) #include <iostream> … | |
Hi guys, I am programming in C++ with NetBeans. It works fine when I playing with just one main.cpp file. But After I added an additianal class (1 .cpp and 1 .h), it makes an error even though I do not make any changes in the new files. (all I … | |
I'm not sure what i'm doing wrong, any help would be great. main.cpp(58): error C3861: 'preOrederHelper': identifier not found main.cpp(53) : while compiling class template member function 'void tree<T>::preOrderHelper(treeNode<T> *) const' with [ T=int ] main.cpp(9) : while compiling class template member function 'tree<T>::tree(void)' with [ T=int ] main.cpp(103) : … | |
I am trying to run chekstyle on all of my files within a project. So I have model, view, and controller folders all with their subfolders of .h and .cpp files. Is there any way to grab all the files that end in .h or .cpp without having to individually … | |
I am using code::blocks and have written a dll. I am currently testing it but am getting tired of having to compile it, copy the DLL, DEF, H and A files into a test project, and then compiling the test project every time I need to fix something. Is there … | |
I was just wondering why do we exactly call glTranste command if its possible just to increase objects x, y or z. And its even stated in this tutorial: http://nehe.gamedev.net/tutorial/particle_engine_using_triangle_strips/21001/ that its even faster to only use Vertex3f() instead of resetting the Modelview Matrix. Anyways, maybe its just something particular … | |
This code: DomainThingy^ thingy = (DomainThingy^)_scriptDomain->CreateInstanceAndUnwrap(Assembly::GetExecutingAssembly()->FullName, DomainThingy::typeid->FullName); Produces this error: System.InvalidCastException was unhandled Message: Unable to cast transparent proxy to type 'Hook.DomainThingy'. Does anyone knows how to fix it? |
The End.