49,761 Topics

Member Avatar for
Member Avatar for ELBUF

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 …

Member Avatar for vmanes
0
134
Member Avatar for swolll

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 …

Member Avatar for swolll
0
255
Member Avatar for invisi

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 …

Member Avatar for Narue
0
122
Member Avatar for Orusaka

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 …

Member Avatar for WaltP
0
91
Member Avatar for BarakH

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 …

Member Avatar for tetron
1
108
Member Avatar for rwill357

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 …

Member Avatar for dusktreader
0
109
Member Avatar for Fbody

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 …

Member Avatar for Fbody
0
162
Member Avatar for AdamE34

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 …

Member Avatar for AdamE34
0
136
Member Avatar for garea

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 …

Member Avatar for Salem
0
120
Member Avatar for nerdinator

I use mfc. Is it possible to serialize member variables in the view class?

0
54
Member Avatar for kilon666

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 …

Member Avatar for sfuo
2
4K
Member Avatar for alcay
Member Avatar for spetsnaz26

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 …

Member Avatar for spetsnaz26
0
1K
Member Avatar for trebauchet1986

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....

Member Avatar for JasonHippy
0
112
Member Avatar for Stefano Mtangoo

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

Member Avatar for Stefano Mtangoo
0
2K
Member Avatar for TheGhost

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, …

0
52
Member Avatar for fidan

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 …

Member Avatar for fidan
0
618
Member Avatar for tennis

Struct Day { explicit Day(int d) : val(d) {} int val; }; what does the colon in the 3rd line means? Thanks

Member Avatar for jonsca
0
103
Member Avatar for suzi_ausi

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'; // …

Member Avatar for Dave Sinkula
0
271
Member Avatar for Audux

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 …

Member Avatar for mrnutty
0
79
Member Avatar for RSBColt

^^^ 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?

Member Avatar for RSBColt
0
148
Member Avatar for MatthewSedam

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 …

Member Avatar for WaltP
0
176
Member Avatar for tennis

[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, …

Member Avatar for mrnutty
0
105
Member Avatar for react05

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 …

0
61
Member Avatar for nats01282

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

Member Avatar for VilePlecenta
0
1K
Member Avatar for iamcreasy

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) …

0
52
Member Avatar for BBKisaki

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 …

Member Avatar for switch3d
0
165
Member Avatar for eternaloptimist

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 …

Member Avatar for eternaloptimist
0
103
Member Avatar for valeriy_zf

[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 …

Member Avatar for jonsca
0
313
Member Avatar for suncica2222

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 …

Member Avatar for Salem
0
168

The End.