49,761 Topics
| |
hai plz help me Iam locking an object in a function fun1() and iam using that object in another function fun2() and unlockin it will the lock still holds good in fun2() the object is globally declared consider the following scenario [code] object obj; void fun2() { fun1(); obj.display(); unlock(); … | |
okay so i've got n and an array of n numbers, i have to go through all the three's of numbers like a[i], a[j], a[k] so that i < j < k and take the maximum of each such numbers (max of a[i], a[j], a[k]). my first guess is three … | |
I'm having to create a program that uses a linked list to ask for X & Y points and stores them in a linked list and then displays those results. My problem here is when it gives me the output I only see the last 2 entries I've made. It's … | |
I am working with a MDI in my program. I use .cpp to compile although I program primarily with api's. I'm not sure whether that places me in C++ or Windows threads. Since using .cpp I have to obey C++ rules so I'll list my thread in the C++ area. … | |
I have a litle problem when i try to list Aluno = Student (option 4 in the program). i have other problem, when i try to save some Aluno(student using option 1) te program telll me that it is already created. Some one can help me? [ICODE] #include <iostream> #include … | |
hello everybody, Can anyone please tell how can i make C++ screen full in windows vista. thank you | |
[CODE] class Base { public: virtual void fn(){cout<<"fn base\n";} virtual void myfn(){cout<<"myfn base\n";} }; class Derived : private Base { private: void fn(){cout<<"der\n";} void myfn(){cout<<"myfn Derived\n";} }; int _tmain(int argc, _TCHAR* argv[]){ Derived d; Base *p = &d; //Error: conversion from derived * to base * exists but is inaccessible … | |
Hi, I have copied the quicksort algorithm out of my text book, but it isn't working properly and there are no compiler errors so I am struggling to debug. it is partially sorting so I think it must be one of the conditional statements or something not declared how I … | |
hello everyone... can you help me with this assignment about hash tables.. I run the code on a linux machine and gave me errors.. here is the assignment and my code in attachment can anyone fix this please...I need to hand it today.. thank you all Asem | |
Hi All, I have a class of type class Row_Entry { public : //CString symbol; CString bid; CString ask; CString bid_size; CString ask_size; CString bmmid; CString ammid; CString type; CString exch; Row_Entry() { } }; I am creating a vectorlike this `std::vector<Row_Entry>RAW_ENTRY;` Now i have pushed all my required data … | |
anyone can help me? please problem: write a program that creates three processes and performs matrix operations at the same time. each process performs a different matrix operation. the program reads three matrices from a text file. the size of the matrix can be of any valid size. use two-dimensional … | |
Whats wrong with this code //--------------------------------------------------------------------------- #include <vcl.h> #include <fstream.h> #pragma hdrstop #include "MainUnit.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1; //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TForm1::Button1Click(TObject *Sender) { //char *acc, *id, *sur, *bal; int col = 0; int row = 1; int … | |
Hey everybody, I'm a little stuck on this simple program I'm trying to run. Right now it takes in a list of words and makes a single string out of them, but what I really want to do is make each word into its own new string, or maybe create … | |
Are there any standard C++ libraries that support multithreading other than windows.h? | |
Hi everyone, This is my first post on the forum, although I've been coming here to find search for help for some time now. I'm taking a C++ programming class, and am having trouble with my most recent assignment. I'm not here for straight-up answers, just a little help. I … | |
does any1 have any idea about how to,when i press a button,print out 1 line of text written by me and when i press it again another replaces the old? i already got the saving working so u dont have to worry about that | |
I'm creating a multiplayer game using winsock, but I've been having several problems with winsock. I've been searching for an alternative to it, but I haven't found anything. If anyone could point me to something I could use in place of winsock (a free something), I would greatly appreciate it. | |
Can anyone explain me pointers to 2D array ?? I have to input array of string using and read them in another function but I am having a REALLY TOUGH time with pointersan anyone explin it to me or refer good guide to pointers ?? I am using borlnd c++ … | |
hi I keep getting the segmentation fault thingie and i think i know the line that is causing the problem, but i dunno how to fix it. please take a look at the code. [CODE] ... class AnotherClass{ ... }; ... class AClass{ private: list<AnotherClass> listName; list<AnotherClass>::iterator it; ... public: … | |
How do you read and display a 2d array? the input text is below i just really have no idea of tried everything :( any sort of help would be appreciated [ICODE]* . . . . . . . . . . . . . . . . . . … | |
I recently completed a small console app that accepts input from the user and places it in a floating point array, which was implemented through a for loop. I have not spent much time studying error handling and was wondering if anyone could refer me to a useful error-handling tutorial. … | |
hello, how do i make both threads have access to the same set of updated data, when they call different functions? in addition, is the way i pass in the variable "myObjs" correct? can i pass in STL containers the same way? example: [CODE] ... class aClass{ ... }; int … | |
hello All, I am trying to write a multi threaded program in C++ , but it suddenly exits and i can not understand what happens , it actually do not get any error message or exceptions error , just get out of the program. need your help, thanks . [code=c++] … | |
Hey guys. After the great help i received with my previous thread of reading in a file, i thought id post up my next trouble. This is my code for my ISBN search function which works fine after the information has been read in to the 'book's. [code]int BookStore::findISBNRecord() { … | |
Hey guys. Im having some trouble with reading from a text file, into a class with strings and ints. Here is my code for my read file function: [code] ifstream infile; infile.open("books.txt"); if (infile.good()) { for (int i=0; i<=5;i++) { getline(infile, book[i].title); //string getline(infile, book[i].isbn); //string getline(infile, book[i].publisher); //string infile … | |
Hi, Could anyone explain me above error? [CODE=cpp] // friend overload + operator function #include<iostream> using namespace std; class Distance { private: int feet; float inches; public: Distance() { feet = 0; inches = 0.0; } Distance(float f) { feet=int(f); inches = 12*(f-feet); } Distance(int ft, float in) { feet … | |
Hello there, I'm trying to compile a project in Visual Studio 2005 and the compiler finds errors in the file fstream.h. Some of them are: c:\program files\microsoft visual studio\vc98\include\fstream.h(88) : error C2872: 'streambuf' : ambiguous symbol c:\program files\microsoft visual studio\vc98\include\fstream.h(89) : error C2872: 'streampos' : ambiguous symbol c:\program files\microsoft visual … | |
Could someone give me a detailed explanation or give me a resource that explains something like how if I created my own custom 3D model that had 8 vertices would that be the same as saying 8 polygons because I always here talk about things like game developing companies throw … | |
Is there any real different between using an union between two types and a reinterpret_cast between two types, for example-- [code=c++] #include <iostream> int main(){ union{ unsigned short *a; float *b; }; float value = 0.6f; b = &value; std::cout << *a << std::endl; unsigned short *s; float *f; f … | |
I have the following code that when compiles with my test program gives me a segmentation fault, I hope you guys can help me with this. I am compiling on a gcc compiler using: [quote] g++ a3test.cpp screen.cpp dtio.c -lncurses [/quote] screen.h header file: [code=c++] extern "C" { #include "dtio.h" … |
The End.