49,757 Topics
| |
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 … | |
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 … | |
| |
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 … | |
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. | |
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! | |
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?? | |
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 … | |
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" … | |
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 … | |
I'm new to [B]Qt[/B]. What resources do you recommend for learning Qt? Thanks. | |
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 | |
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 … | |
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 : " … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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. | |
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] + … | |
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. … | |
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 … | |
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. | |
| 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 << … |
The End.