49,761 Topics
| |
Hey there, working on a program thats going to have a bunch of functions, but for now I am stuck on something that will be reused throughout the program alot: passing a string pointer to a function. It may seem redundant or arbitrary that I am passing it as a … | |
Hello my problem is that I am not for sure my vector < vector < string > > addresses; is correct. What I am looking for is to read in from a file which looks like: name:dfsd@msn.com name:dfsd@msn.com name:dfsd@msn.com Once my code parses through the file, addresses should look like: … | |
Hello, How can I calculate the normal vector giving a vertex on a 2D plane in OpenGL. ? All what I read was all about 3D and cross product of two vectors. the only thing that I have is that vertex and I want to construct a vector coming out … | |
Hiya, I'm pretty new to C++ (using bloodshed dev). I am trying to display the path of a projectile (tennis ball) on a graph. I can do all of the calculations and output to a text file at each point however I can't find anything on the internet to explain … | |
Implement Quick sort algorithm with partition of 3 elements, partition of 5 elements, partition of 7 elements, partition of 9 elements and partition of 11 elements for the data set of 10000 elements. Can anyone tell me what is meant by "partition" in the above? | |
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. |
The End.