49,761 Topics
| |
Hey guys, Just wondering if someone can help me out with this. I want to read in a text file (team.txt) and have it implemented into the rest of my code. My program will read in from the file, the number of players and their heights and print out some … | |
allPlaylists is a vector of type Playlist. listSongs is a vector of type *Songs. [code] //Loop that goes through each element in the playlist vector. for(int k = 0; k < allPlaylists.size(); k++) { // loop that goes through each song within the Playlist vector element. listSongs is a vector … | |
Well I wrote this programme, hoping what I wrote is a lenear sorting algorithm if it's not pls tell me :-O [CODE] #include <iostream> #include <string> using namespace std; int main() { int a[10]; int num = 0; int number = 0; cout << "Enter 10 int..." << endl; for … | |
Okay, so I have a program that read integers from a file and stores them in an array. The relevant code: [code] readLevel.open("level.txt"); if((readLevel.is_open())) { for(int rows = 0;rows<=BLOCKROWS-1;rows++) { for(int cols = 0;cols<=BLOCKCOLUMS-1;cols++) { blocks[rows][cols] = readLevel.get(); } } } [/code] However, here's the trouble. Instead of reading the … | |
Hi guys, First of all I'm new here so how are you all? and nice too meet you! :) My name is Barak, I'm a first year student in Computer Science although I have some experience (studied in John Bryce). We recently had a test where I think my teacher … | |
Hello having some issues with my logic. I have to write a function that determines whether a given string is palindrome. I have to use multiple stacks for implementation. I have began coding and it compiles however it is not working correctly. I think the problem is within my while … | |
A couple days ago, I was involved in [URL="http://www.daniweb.com/forums/thread258996.html"]this thread[/URL] which concerns bit shifting (kind of) and a solution was found (by someone else). The problem is, something about the solution never really sat right with me. Hopefully someone can clarify this for me. [B]Code:[/B] The code uses 1 constant … | |
I'm a relative beginner, taking a c++ class, and I'm trying to output this stream of numbers to a .txt file. I'm having no problem actually getting them into the file, but I can't figure out how to get the numbers to line up in columns or rows instead of … | |
Hi, I'm searching for an XML streamming parser, but I dont know wich one I must use. I have to parse very large files, and i need to use threads because i need to do some things before the parsing of all the file has finished (that's what a streamming … | |
I use mfc. Is it possible to serialize member variables in the view class? | |
I want to find the determinant of a square 4x4 matrix using a minor and cofactor. And I want those in three seperate functions where i is the number of rows and j is the number of columns: [CODE]double minor(double a[][4], int row, int column);[/CODE] Done by removing a row … | |
I've got this annoying "access violation" problem. I've done searching for a whole day on the Internet and although I didn't find any solution specific to my problem I do understand "unhandled exception in abc.exe:0xC0000005: Access Violation" has something to do with inappropriate use of pointers. However where the error … | |
I have c++ functions in which all the arguments are integers....I was wondering if there was a way of telling the computer this, other than typing int before each and every variable....I tried function S(int a, b,c..) but did not work.... | |
Hi All, what is method to get all availabled disk drives and their status. By status I mean whether they are hard disk or CD/DVD or USB? Also how to get list of Drives in *nix? Thanks a lot | |
hello, im making IRC clients with both C++ and Java SE. i've come across a peculiar problem when i send the message using my program (or when sending it using telnet) send: "PRIVMSG test hello, this is a test" receive: "hello," what can i do to fix this problem? secondly, … | |
Hello, I have compiled a GCC plugin successfully, but I get error when linking: [CODE]$ make /opt/imo/bin/g++ -g -fplugin=../libimo/libimo.so -o test main.cpp cc1plus: error: Cannot load plugin ../libimo/libimo.so ../libimo/libimo.so: undefined symbol: _ZN11NodeFactory10CreateNodeEN4BEEV4KindERKNS0_7ASTNodeES4_RKSt6vectorIS2_SaIS2_EE make: *** [default] Error 1 [/CODE] I know that the plugin works fine for other Ubuntu users, so … | |
Struct Day { explicit Day(int d) : val(d) {} int val; }; what does the colon in the 3rd line means? Thanks | |
Please explain me in detail : [CODE]const char *str1 = "pointer to constant"; char *const str2 = "constant pointer"; const char *const str3 = "constant pointer to constant"; str1[0] = 'P'; // illegal! str1 = "ptr to const"; // ok str2 = "const ptr"; // illegal! str2[0] = 'P'; // … | |
Hi all, I'm new to C++ after having worked with c# and java for a number of years. I'm having trouble getting my head around destructors and their proper use. take for example this problem i'm working on at the moment. you have a double linked list centered around a … | |
^^^ Typing fail, should be possibly ^^^ What is the best cross-platform library for high-performance graphics. I have tried SDL and GLUT, but I want to know if there are better ones out there. Also, is there a simple way to access OpenGL without a front-end library? | |
This is a basic calculator I made in C++. I am learning C++ on my own. [CODE] #include <iostream> using namespace std; float Add (float &a,float &b) { float c; c=a+b; return (c); } float Subtract (float &a,float &b) { float c; c=a-b; return (c); } float Divide (float &a,float … | |
[code] class TextBlock { pulic: ... const char& operator[] (std:size_t position) const {return text[position];} char& operator[] (std:size_t position) {return text[position];} private: std::string text; }; [/code] for the member functions why the return type is reference to char char& instead of char? return text[position] is a char for sure,not an address, … | |
Hey guys. I'm making a program for tic tac toe but i'm stuck now. I want to move the section in the while loop from the main function at the very bottom to a new public class called nextMove but I'm not sure how to do that. Also How can … | |
Hi all im new to c++, But im after a code that can make c++ put text in a window that i can copy and paste, any help. if you need more info please ask. Thank you | |
Im trying to solve ACM - 10082 [URL="http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=31&page=show_problem&problem=1023"]http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=31&page=show_problem&problem=1023[/URL] Judge is responding wrong answer...but, i have no idea why. Any suggestion? [CODE] #include<iostream> #include<string> using namespace std; char change(char x); int main() { string str1; getline(cin, str1, '\n'); transform(str1.begin(), str1.end(), str1.begin(), change); cout << str1; return 0; } char change(char x) … | |
Hi Pros! I've started a project called grina ( code name) which is web browser program fro people to view web pages using C++ with Qt based on the QtWebKit module. The fact is that, i know a little about the web browser system, that it acts like a compliers … | |
i have a few questions.: 1)if i wanted to write a line of code needed to declare a 1-dimensional array named names that can hold 8 string values would this be correct?: char names[8]; 2)how would i write the code needed to assign strings to each element of the array … | |
[B]Microsoft Visual C++ 2008[/B] My Project contains one Form1 and one Unit (module) Test1.cpp. There is the button1 on the Form1 which calls the function: [CODE]Test1::Change_Button_Text();[/CODE] There is only one function in unit Test1.cpp [CODE]void Test1::Change_Button_Text() { // #1 Form1::button1->Text = "Hello forum!"; // isn't working :( // #2 Form1 … | |
I have problem with this code,I want to print names of the windows in .txt file and it compile with no errors but it snaps in runtime. this function int x = GetWindowText(hWnd,title, 256); for the second arg require char* and cant deal with WCHAR and if i cast title … |
The End.