49,761 Topics

Member Avatar for
Member Avatar for OffbeatPatriot

I've been trying to read this binary file I wrote with a python script. The format of the file is this, first there is an integer that tells how many floating point numbers follow that integer(there will be 5 times this number), then the floats follow, another integer, etc. I've …

Member Avatar for Ancient Dragon
0
143
Member Avatar for belle phoenix

[code] #include <iostream> #include <fstream> #include <cstdlib> // to clear the screen #include <cmath> #include <string> using namespace std; #ifndef NULL #define NULL 0 #endif int MAX_FLOOR=10; struct passenger { int id,waitingtime,timestamp; float source,destination; passenger * next; }; struct node /*this is the linked list that contains source and destination …

Member Avatar for Agni
-3
294
Member Avatar for jigglywiggly

So ok, I have been doing like java for a year and a half, and this is my lovely 4th day of C++, and I have already read up on pointers, dynamic memory and all that fun stuff. I do know what the header file class does. However I got …

Member Avatar for Agni
0
156
Member Avatar for froggy1976

Here is what is required: Create a new console application project and name it "Week1Lab_YourName". Create a new class called DayOfTheWeek. The class should have a data member that can store the day of the week such as Mon for Monday, Tues for Tuesday etc... STEP 2: Create the member …

Member Avatar for C++Rookie
0
189
Member Avatar for biesczadka

I have a template which can be initialized with container list, vector or my own create container zbior and struct element as an El: [code] template<typename El, int colsNo, typename Container> struct CSVReaderWriter { Container m_cont; void read (std::istream & _input) { string linijka; vector<string> entry; string laaa, naa; int …

0
65
Member Avatar for cyberguy007

Can someone help me create a function to print all items with a Prod_Stockcount less than 5? Its missing some code but all you need is to add and then create a function to print items with stockcount less than 5 [CODE]# include <stdio.h> # include <string.h> # include <iostream> …

Member Avatar for jonsca
0
115
Member Avatar for SasseMan

Hi, I have a problem with two classes who both has instances to each other. Here are the header files... [code] #ifndef ENVIRONMENT_H #define ENVIRONMENT_H #include <vector> #include "item.h" #include "actor.h" namespace game{ class Environment{ public: Environment(){} Environment(std::string name_, std::string description_); enum directions { north = 0, north_east = 1, …

Member Avatar for Ancient Dragon
0
111
Member Avatar for ishaiman

HI, i am the student of MIT. C++ is my subject. I feel confusion in FUNCTIONS. can you help me? > It works if you get rid of `getline(inFile, Library[i].genre);` I didn't try it but it might have worked with `inFile >>Library[i].genre`, but mixing getlines and >> can cause trouble. …

-2
45
Member Avatar for pcpp

hello , i am starting to program my project in c++ i need help in direction. my project is like wikpedia . i should enter about 3 value in each catagory (3*7) . the search will be by pressing some value and then a list will open with all the …

Member Avatar for VernonDozier
0
101
Member Avatar for subscriptions

Hi, I tried compile the VC++ project in visual studio 2008. I'm getting the error "the null device is missing from your system". I tried viewing non-plug and play drivers for Null device. But could not find it. Could anyone help me to fix this issue. I'm using Vista Home …

Member Avatar for Ancient Dragon
0
43
Member Avatar for jakesee

Hi, I am playing around and trying to understand template singleton class and I accidentally created something that I am surprise it even runs. What I don't understand is when did Apple and Orange instances get created? Could you also comment on the good and bad of the Singleton class …

Member Avatar for jakesee
0
483
Member Avatar for flying_bird

Hi guys, The following code doesn't compile, and I've been banging my head why. Some header code: [code] template <typename T, typename LESS_THAN> class RestrictedSet { private : int _size; int _max_size; set<T, LESS_THAN> _S; typedef typename std::set<T, LESS_THAN>::iterator tIt; public : RestrictedSet (int max_size); RestrictedSet (RestrictedSet<T, LESS_THAN> &other); ~RestrictedSet …

Member Avatar for flying_bird
0
758
Member Avatar for Excizted

Hi people. :) I'm making a function callback system for a console, so I would dynamically be able to send a function pointer to my console class, and then it would be callable from the console. Well, it works - but only with functions that are not member of a …

Member Avatar for Ancient Dragon
0
257
Member Avatar for pac-man

Hi guys, just playing about with pointers and keywords and to my surprise, this code does not throw up an error... can anyone tell me why? [CODE] int main() { int *P = new int; *P = 50; cout << *P << endl; // output: 50 delete P; *P = …

Member Avatar for pac-man
0
114
Member Avatar for Slammer

Hi there. I need to write a recursive DFS function for graph which is implemented as follows: [CODE=c] struct nodes_arr { unsigned int position[50000]; unsigned int amount[50000]; node *next[50000]; } nodes_table[] = {0};[/CODE] [CODE=c]struct node { unsigned int position; unsigned int amount; node *next; };[/CODE] as a result i have …

1
110
Member Avatar for Noor Ur Rehman

i am Noor.Student of computer science.this website is very helpfull for programmer students.all my friends likes your site and coopration. I HAVE AN ASSIGNMENT (structure of students using array sorting, fuctions and using pointers to display students in sequence order) SUBMISSION DATE IS 14/1/2010 PLZ ANY BODY HELP ME. THANKS …

Member Avatar for SgtMe
-5
82
Member Avatar for mellowmike

I wasn't sure whether to put this question here or in the Windows section, but I was wondering if there was a way to put images into a Visual C++ project. That way, I won't have to load an image from an outside directory, and it will already be in …

0
57
Member Avatar for cwarn23

Hi and I am making a dll but the dll won't accept pointers due to what it links to. So below is my code and does anybody know how to make a string array without pointers? Also I'm using Visual c++ 2008. [CODE]//#pragma warning(disable:4996) //disable "depreciated function" warnings #include <windows.h> …

Member Avatar for Ancient Dragon
1
203
Member Avatar for Szabi Zsoldos

My question is the following, i'm just figuring out this language, now my question is about the "n" number. What is the role of n<5, i know after this condition it continues the for or not. But i can't find the precise explanation of the "n" . Thank you. Why …

Member Avatar for WaltP
0
71
Member Avatar for rehamz

i want to know how to make trace to my program in Microsoft visual c++ 6. thanks

Member Avatar for Ancient Dragon
0
56
Member Avatar for jegadees

Hi, I am trying to work out a simple code in C++.I am getting the input as a string and the output should be reversed.Some thing like this input ="Glitters are Not gold" output should be "gold Not are Glitters". What i have done is get the string and stored …

Member Avatar for mrnutty
0
138
Member Avatar for ge6a93

Hello, i'm using VC++ 6.0 with MFC library and i want to load PNG images in my dialog based application. Can anyone help me??? Thanks in advance!

Member Avatar for vmanes
0
61
Member Avatar for CppBuilder2006

I need an API function that disconnects the computer from internet! does type of connection matter? eg dial up, adsl or.. :)

Member Avatar for CppBuilder2006
-2
574
Member Avatar for tinkeydo

[CODE]#include <iostream> #include <windows.h> #include <fstream> #include <string> #include <ctime> #include <vector> using namespace std; bool fileCheck(const char *filename) { ifstream ifile("item.txt"); return ifile; } int show(int p) { srand( time(NULL) ); int random_integer; random_integer = ( rand ( ) % p ) + 1; return random_integer; } int main …

Member Avatar for tinkeydo
0
393
Member Avatar for flying_bird

Hi guys, I am looking for an STL solution for the following problem. The desired behaviour is the following: - It should act as a priority queue - When an item is added, the item with the *lowest* priority should be dropped. I thought of doing that by making a …

Member Avatar for flying_bird
0
169
Member Avatar for ireimaima

Hi....can anyone help me to explain what is the use of isPrime=true; in the last line of this coding..?? I found that it is very important because if i delete it, the answer of the prime number will always constantly 2 and 3.. Even if i put 7 as the …

Member Avatar for ireimaima
0
120
Member Avatar for Joehype

Hi guyz, could anyone please assist me with a code to load an image bmp, pln etc in C++. I'm using OpenGL Library. Please assist, in dire need. Joel

Member Avatar for mrnutty
0
173
Member Avatar for ireimaima

Hi...there,,can anyone debugging my code.. this program intend to find the average and count how many numbers is positif and negatif from 10 numbers entered by user. My problem is when i run the program the result of average is correct but somehow on the result of negatif and positif …

Member Avatar for ireimaima
0
151
Member Avatar for jakesee

Hi, This is a very convoluted problem I spent hours debugging to find that when I call std::vector<object>::push_back(Object()) destructor of previous Object is called. Is this the behaviour of std::vectors or is something wrong with my code? [CODE]#include <iostream> #include <vector> class Manager; class Entity { friend class Manager; private: …

Member Avatar for jakesee
0
435
Member Avatar for ashishchoure

hi, I want to know how to get name of connected peer. I am creating a simple client server application using winsock2. When I use getpeername() function it gives me IP of client machine. After connecting i did following step [CODE] sockaddr_in peeraddr; int size = sizeof(peeraddr); getpeername(New_Socket, (struct sockaddr …

Member Avatar for Excizted
0
1K

The End.