49,757 Topics

Member Avatar for
Member Avatar for flowerzink

Hello guys! I'm having a rather pesky problem working with fstream. I could write, for example: [CODE]fstream file("text.txt");[/CODE] then file should be open in read/write mode. But then if I do the following: [CODE]file << "Some text"; file >> string_var;[/CODE] or in the opposite order, it will only perform the …

Member Avatar for Ancient Dragon
0
165
Member Avatar for mark103

Hi guys, I would like you to help me. I have figure out that I will get the errors of 'Form2' : undeclared identifier as if I included the "#include Form1.h" on the top of the Form2 class while I have the "#include Form2.h" on the top of the Form1 …

Member Avatar for Ancient Dragon
0
98
Member Avatar for geekme
Member Avatar for mike_2000_17
0
160
Member Avatar for thunderbird24

hi everyone! this is my encryption routine (using standard call) in x86 Assembler __ASM{ encrypt: push ebp mov ebp,esp mov eax, [ebp+8] mov ecx, [ebp+12] push eax and eax,0xAA not al mov edx,eax pop eax and eax,0x55 xor ecx,edx xor ecx,eax rol cl,1 rol cl,1 mov eax,ecx sub al,0x20 pop …

Member Avatar for rubberman
0
262
Member Avatar for shauzi158

People, i have downloaded a game cod from the internet and it wont run.. it always gives a linker error and i don't know what to do. i am new to allegro game development and i really need help.

Member Avatar for rubberman
0
74
Member Avatar for TailsTheFox

Hello, I'm looking for an easy way to wait for a keypress in a non-gui application. Example: I press A, program says "You pressed A" I AM NOT LOOKING FOR STRINGS AND ENTER! THIS NEEDS TO WORK FOR THE ARROW KEYS!

Member Avatar for rubberman
0
102
Member Avatar for frenzra

how we write array for dis problem: int movie title; int no of customer ; int no of day ; double ticketprice ; double drinksprice ; double studentprice ; anyone knows??

Member Avatar for frenzra
0
110
Member Avatar for jimJohnson

I am trying to finish this palindrome program and the only output I get is output cannot be found. Can anyone show me what I am doing wrong. I will put the instructions in if needed for a guide to show what it needs to do... [CODE] #include <windows.h> #include …

Member Avatar for abhimanipal
0
169
Member Avatar for codeyy

I am trying to write pop() function in a file but I am really stuck. It looks like it is asking to delete the top element of the stack and returns a Bookmark pointer. Please, help!! I am showing the header which explains what needs to be done. [CODE]#include "Bookmark.h" …

Member Avatar for Narue
0
161
Member Avatar for sergent

C:\Users\Kostya\Desktop\c++\MacroWriter\ifexists.cpp|27|error: ambiguous overload for 'operator=' in '((farm*)this)->farm::sendeachbase[i] = 0'| Ok so I am making a class for my program and I want to initialize some of its variables to 0's. I haven't done anything with classes for a while so I am not good with this stuff. This is my …

Member Avatar for mrnutty
0
251
Member Avatar for SWEngineer

I'm new to [B]Qt[/B]. What resources do you recommend for learning Qt? Thanks.

Member Avatar for SWEngineer
0
227
Member Avatar for Kunal Aggarwal

I have a external chr file which borland graphics (BGI) use in the C++ compiler. The question is how do I use the font..? Do i need to register it with the BGI graphics driver or something, if yes, how?? I am using TC 3.0

0
78
Member Avatar for sha11e

When writing this: [CODE] #include <iostream> #include <iomanip> using namespace std; int main() { float number = 2.12345; cout <<fixed <<setprecision(3) <<number; return 0; } [/CODE] I get 2.123 If I then cout another float variable that I want all decimal numbers at, and not setprecision(3)...... How do I do …

Member Avatar for sha11e
0
3K
Member Avatar for Drakswan

Hey there , I have a problem about saving information, which is read from a text file, to an char array.I have to read the file character by character.I could't use getline() function and string, I have to use get() function.There is a sample of the all data : " …

Member Avatar for Ancient Dragon
-1
1K
Member Avatar for C++NewBe

Based on my header file. How would I write a complete definition of the function temp (). [CODE]const int MaxDays = 31; // Maximum number of days in a month const int MaxTimes = 5; // Maximum number of times temperature is measured in // a day plus one column …

Member Avatar for VernonDozier
0
135
Member Avatar for tc121091

Here is the question : [URL="http://www.sendspace.com/file/qu6bpi"]http://www.sendspace.com/file/qu6bpi[/URL] I upload the code to my school checking system, and it said that I can only pass 6 hidden cases out of 10. I don't know where the problem is. :'( [COLOR="Red"]Here is my code :[/COLOR] (can only use looping,if,array,pointer) [CODE]#include<stdio.h> #include<math.h> #define N …

Member Avatar for VernonDozier
-1
89
Member Avatar for sdr001

Note: vector < vector < string > > addresses; I am having a problem with this line of code: addresses.push_back(addy.c_str); I am trying to push back an email address in the i location of the 2-d vector. I have tried: addresses.push_back[(addy.c_str)]; and addresses.push_back[i][(addy.c_str)]; but nothing is working >:/ I appreciate …

Member Avatar for sdr001
0
160
Member Avatar for Bastiondar

Is changing the currentLoc variable with an [B]IF[/B] statement a bad way to terminate this loop below? I'm told: [I]"...something in the loop body must cause the expression to become false at some time. One of the things you do not do ever, is write an if statement to change …

Member Avatar for Bastiondar
0
350
Member Avatar for TheWolverine

Hi all, I've setup a class within my software package to read generic text files. For this, I'm using the getline( ) function and then parsing each line for specific types of files. In setting this up, I've come across the ACSII incompatibilities between Windows systems and Unix systems. I …

Member Avatar for mike_2000_17
0
385
Member Avatar for bleedsgreen33

I'm working on a simple recursion function that takes a number and then adds the digits together, say 12345 = 1+2+3.....=15 I have that part: [CODE] int DigitSum(int number, int sum){ //if the remainder of the number / 10 is 0, return the sum if(number % 10 <= 0){ return …

Member Avatar for Fbody
0
138
Member Avatar for GhostMonkey

I've been trying all day to write an array into a file but it doesnt work. The code I'm using is: [CODE] fstream myfile; myfile.open ("array.txt"); for(int i=0;i<=9;i++) { for (j=0; j<9; j++) myfile<<array[i][j]<<endl; } myfile.close();[/CODE] What am I doing wrong? This works if I knew what I was writing …

Member Avatar for GhostMonkey
0
102
Member Avatar for MarginOfBuffett

Whenever I try to compile my Song class I get a ton of linker error messages. I'm using the Dev-C++ compiler. Here's my code: //The header file [CODE]#include <iostream> #include <iomanip> #include <fstream> #include <string> using namespace std; class Song { public: Song(); Song(string title, string artist, string album); void …

Member Avatar for Narue
0
257
Member Avatar for dyingatmidnight

ETA: okay take two, I thought I had the problem fixed, turn out no. Okay so I'm a student on work term teaching myself C++ coming from a background in Java, having done that for the past two years in school. I'm having a tough time with some concepts and …

Member Avatar for mike_2000_17
0
235
Member Avatar for eman 22
Member Avatar for trobinson6453

I need to create an integer array with 10 elements, write a function that will have the user enter the data. The function will return nothing and has 2 parameters, the array and the size of the array.

Member Avatar for ziggystarman
0
53
Member Avatar for jshoot

Hi everyone, I have a 2d array whith 50000 lines and 14 columns, and I have to sum/multiply each value of a column for a fixes numbers, like this: a[1][14] = 0 a[1][14] + 2 = 2 a[2][14] = 2 a[2][14] + 2 = 4 a[3][14] = 5 a[3][14] + …

Member Avatar for zeeshan soomro
0
711
Member Avatar for TheSassyDragon

Trying to understand two dimensional vector and was wondering if anyone could help me out on a sorting code for this so that it numbers 0-9 people, gets x number with each of them and then outputs the person (number) ate x pancakes - But in descending or ascending order. …

Member Avatar for TheSassyDragon
0
154
Member Avatar for stemiros

Hi, I have a list of base types which stores multiple derived types. The following code shows a simplified setup. [CODE]#include "Base.h" #include "DerivedA.h" #include "DerivedB.h" #include <iostream> #include <list> void main() { std::list<Base*> base; std::list<Base*> *basePointer = &base; for (int i = 0; i < 10; i++) { basePointer->push_back(new …

Member Avatar for mrinal.s2008
0
2K
Member Avatar for geekme

Hello, for a project on network simulation I need to show graphical representation of the graph.Which library files can I use for the purpose?Should i switch to OpenGL.I know nothing about graphics in C++ right now.Please help. Regards.

Member Avatar for mike_2000_17
0
130
Member Avatar for Chris11246

Im trying to install the opencv libraries and i tried following the instructions at: [URL="http://blog.cuvilib.com/2011/03/22/how-to-build-opencv-2-2-with-gpu-cuda-on-windows-7/"]http://blog.cuvilib.com/2011/03/22/how-to-build-opencv-2-2-with-gpu-cuda-on-windows-7/[/URL] but Im having problems getting the sample code to compile. When I try: [CODE]#include <iostream> #include <opencv2/opencv.hpp> #include <opencv2/gpu/gpu.hpp> using namespace std; int main() { try { cout<<cv::gpu::getDeviceName(0); } catch(const cv::Exception& ex) { std::cout << …

Member Avatar for rubberman
0
276

The End.