49,757 Topics

Member Avatar for
Member Avatar for TuteePink

I don't understand this code: T& operator[](int index); const T& operator[](int index) const; And, declared in the private is this: T *ptr; What does this mean?

Member Avatar for mrnutty
0
146
Member Avatar for mark5rockzz

So I need this libpng to be statically link with my dll to be used by my exe. This dll is already done before until I switch my compiler from MSVC to MinGW, then this dll won't work anymore so I think I should rebuild it **again** through MinGW. Now, …

0
68
Member Avatar for Jorox03

I am trying to add a comma to the end of each line ('\n') of a text file til the end of the file is reached. I am opening the file in append mode but am unsure as to how to go about identifying when the end of line is …

Member Avatar for Jorox03
0
4K
Member Avatar for MRehanQadri

Suppose my file a.txt has "ABC" written in it. Now I want to write a small b before capital B in the file. How will I do it? I've tried to do it but i'm having problems. 1. When opened in app mode seekp doesn't work. 2. When opened normally …

Member Avatar for MRehanQadri
0
218
Member Avatar for slyton
Member Avatar for TuteePink

I have a header file, but I don't know how to do it: I am new to templates. template <class T> class Array { public: Array(int l, int h); Array(int s); Array(const Array& other); ~Array(); T& operator[](int index); const T& operator[](int index) const; int get_size() const {return size;} private: int …

Member Avatar for TuteePink
0
99
Member Avatar for breezett93

Hi Everyone, I have a program that takes data in a two dimensional array, performs simple calculations, and then writes the data to a file. When I call the function that calculates and writes, I get an error on the two dimensional array stating: "argument of type 'int' is incompatible …

Member Avatar for Labdabeta
0
3K
Member Avatar for Avneet1993

I recently got a question by my tutor to wite a program in C++ and the question is as follows so can someone else try out with it by writing another program in C++ since i have already written it in 2 ways and would like someone else to try …

Member Avatar for tinstaafl
0
174
Member Avatar for davecoventry

I'm trying to run a file called configure.bat which contains the following: echo off mkdir Platforms mkdir Platforms\bb2010wm FOR /F "tokens=2* " %%A IN ('REG QUERY "HKLM\SOFTWARE\CodeGear\BDS\7.0" /v RootDir') DO SET BCB2010_ENV_ROOT=%%B cd Platforms\bb2010wm ..\..\build\cmake\bin\cmake.exe -G "Borland Makefiles" -D CMAKE_C_FLAGS:STRING="-g0 -tWM -WU -x -xd -w-8012 -w-8027 -w-8026 -w-8066 -w-8022 -w-8004 …

Member Avatar for gusano79
0
547
Member Avatar for nomorelogic

so i have a mini text adventure game where i can go through the rooms and have made a start trying to implement a inventory, i can type things in and store them in a text file, but i want to be able to find an object in a room …

Member Avatar for Moschops
0
2K
Member Avatar for MasterHacker110

I am getting an iphone soon and would like to write some programs for it using c++, I know all about apple and objective c but I want to use C++, as I am more skilled in C++. So is there a compiler out there that will enable me to …

Member Avatar for Schol-R-LEA
0
321
Member Avatar for massivefermion

I'm using windows 8 and I wanna know can I cross compile a C++ program for symbian Belle?How? Thanks

Member Avatar for massivefermion
0
126
Member Avatar for sameh.abdulah.1

Hello, I read a large file (>7GB) from disk. The file is as set of attributes like this: 0.2,0.3,0.5,0.6,0.8 0.5,0.7,0.2,0.2,0.5 . . I want to read only the first columns(i.e. 0.2, 0.5,...) into a vector. I do not need the other columns. The problem that when I use the fstream …

Member Avatar for Ancient Dragon
0
270
Member Avatar for CodyOebel

Is there a simple function that will allow me to output an out file stream to hex from an int. Let me give you an example of what I am trying to do. { ofstream out; out.open("c:\\test.txt"); for(int i = 0; i<20;i++) { out::ios::hex<<i; }; the above code does not …

Member Avatar for gerard4143
0
138
Member Avatar for lecet98

how to get the source code to dll that are already build?? because the source code is my clear all, and only the remaining dll.. how you can help, thanks :)

Member Avatar for Ancient Dragon
0
52
Member Avatar for aroojasif22

`Inline Code Example Here`Can anyone please give me the code for copy detection. OBJECTIVE: A program that detects copied codes.<o:p></o:p> Sometimes students tend to submit copied assignments and detecting copy cases manually can be very time-consuming. You are going to write a simple software that compares two files word-by-word and …

Member Avatar for aroojasif22
0
159
Member Avatar for arcticman452

I am building a game similar to the tron game. I want to use the arrow keys to control the movement of the player. I do not have all the code completed but attached what I have so far. #include<iostream> #include<string> #include<conio.h> #include<Windows.h> #include<cstdlib> #include<ctime> using namespace std; //Declarations bool …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for ilian.bonov

My program is working perfectly but when I want to initialize the default constructor which is all zero's it prints -9.25596e+061 . Hier is the code : class Sales { private: static const int QUARTERS = 4; public: double sales[QUARTERS]; double average; double max; double min; Sales(); Sales( double ar[]); …

Member Avatar for ilian.bonov
0
137
Member Avatar for dshiells

Hi, In Windows 7 (and possibly older, can't remember off the top of my head), you can select which icons appear in your taskbar and which ones are only visible if you click the up arrow. Is there a way to set this default programatically? If it's relevant, my current …

0
148
Member Avatar for kortneycoles

I'm making an address book for class and i'm stuck. The teacher helped with some of the code I already have. Sorry for the lack of comments. I need help with the function to add records and then save them. Thanks #include <iostream> #include <fstream> #include <iomanip> #include <string.h> using …

Member Avatar for kortneycoles
0
172
Member Avatar for cnet1989

I'm a computer science major and I'm taking an intro to C++ programming course. I have to write a program that reads in the data from a .txt file and echoprint it, and also print the data again but with every fifth word with 10 underscores. I was able to …

Member Avatar for mike_2000_17
-1
614
Member Avatar for rpcob

Hey, we just started learning functions in class. We were given a project to complete. I'm trying to work out the errors, but I'm stuck with error C2084: function 'void bubblesort(int [],int)' already has a body error C2084: function 'void print(int [],int)' already has a body error C2084: function 'void …

Member Avatar for Captain119
0
4K
Member Avatar for christinetom

Hello again everybody. I have a question which may be very basic for allot of you, so here it goes. I want to understand the process of creating makefiles. I've I realise there's some books out there like 'Mastering Cmake' and 'GNU Make' which describe the insides of these things, …

Member Avatar for Tumlee
0
256
Member Avatar for SA_PlaYeR
Member Avatar for yuugib

Hey guys, I have been reading the forum for a while, but I couldn't find anything that could help to figure out my current assignment. Its a very simple program, but somehow just doesn't work for me. I'm a beginner and I hope that somebody can explain what am I …

Member Avatar for meggy12
0
328
Member Avatar for irtza

// In this program: when i compile this program, the complier shows error in the main section(I have mention this error in main section) that is "can not convert sample to sample in assignment". this error is occuring only when i try to access private members of class through pointer …

Member Avatar for samiz4j
0
292
Member Avatar for kcys.wong

#include <iostream> #include <fstream> #include <windows.h> #include <ctime> #include <string> #include <iomanip> using namespace std; enum ConsoleColor {Black, Blue, Green, Cyan, Red, Magenta, Brown, LightGray, DarkGray, LightBlue, LightGreen, LightCyan, LightRed, LightMagenta, Yellow, White }; void line(void); const int Start=1900; void write_Data(); void Read_Data(); void SetColor(int text, int background=Black) { HANDLE …

Member Avatar for Ancient Dragon
0
252
Member Avatar for mohammad.alsheyab

This is a C++ program that reads as input a text file. The file is read character by character and count the number of unique characters.

Member Avatar for Stuugie
-2
138
Member Avatar for breezett93

Hi everyone, I am writing a program that converts numbers to words and vice-versa, like typing on a older cellphone. The user enters as many messages as he wants in numbers and/or text. The first character of the messages indicates what the remaining string is: numbers or letters. I can't …

Member Avatar for tinstaafl
0
224
Member Avatar for mohammad.alsheyab

Huffman Code In this assigment, you need some text files. Click HERE to download some. In this assignment, you are to implement the Fixed-length Huffman coding that we learn in the class. You should perform the following: 1- Huffman Encoder. a. This is a C++ program that reads as input …

Member Avatar for Ezzaral
0
212

The End.