49,761 Topics

Member Avatar for
Member Avatar for esash28

Hi everyone.. I am a new programmer to OpenGL using C++. I have an nxn grid having numbers in each cell of the grid.. I have to swap the content of two cells.. ie., the numbers in 2 cells selected, have to be swapped. I am not knowing how to …

Member Avatar for daviddoria
0
927
Member Avatar for xcarbonx

[CODE] getline(inFile, st[i].name) while (inFile){ inFile >> st[i].id >> st[i].eng101 >> st[i].hist201; i++; getline(inFile, st[i].name); [/CODE] The above code only reads the first line of my input file, and the rest prints out zeros. My input file is set up like: John Wall 345505050 95 66 The output looks like: …

Member Avatar for kenji
0
88
Member Avatar for pichi89

Hey, I need a function that virtually increase the size of an array, by creating a new array with the size of the old array plus the default array size and copying the content of the old array to the new array, finally returning the new array. This is a …

Member Avatar for Fbody
0
90
Member Avatar for yznk

I am writing a sort program and i am getting the error " error: no matching function for call to 'Object::setdepend(Object*&)' " in this line " graph[i]->setdepend(graph[atoi(buffer.c_str())]); " which is in my read function. I am not sure how to fix this, can anyone help? [CODE] #include <iostream> #include <fstream> …

Member Avatar for Fbody
0
1K
Member Avatar for bondzerg

HTML files use tags enclosed in angle brackets to denote formatting instructions. For example, <B> indicates bold and <I> indicates italic. If a web browser is displaying an HTML document that contain < or >, it may mistake these symbols for tags. This is a common problem with C++ files, …

Member Avatar for bondzerg
0
375
Member Avatar for dragontruong

This is what my debugger says, but I can't find the problem. Holding.h:15: warning: `class Holding' has virtual functions but non-virtual destructor In file included from p6.cpp:12: Recording.h:13: warning: `class Book::Recording' has virtual functions but non-virtual destructor p6.cpp:90: error: expected `}' at end of input Book.h:14: warning: `class Book' has …

Member Avatar for mitrmkar
0
156
Member Avatar for Ricky65

Hi I've been having problems retrieving a webpage using HTTP GET in winsock. I used a packet sniffer to construct the header and the GET Request appears fine although I receive a "400 Bad Request Error". Thanks if you can help. Ricky My code: [CODE] int HTTP_GET() { WSADATA wsa; …

Member Avatar for Ricky65
0
361
Member Avatar for trantran

I've look in the C++ standard and, when listing list of compound stuff, it does not mention anything like "pointer to [B]data [/B]member of an instantiated class". So the question is: [CODE]struct test{ int a; double d; ..... //more complicated stuff here to make it a NON-pod structure) .... }; …

Member Avatar for trantran
0
120
Member Avatar for BobC22

Hi, I have been working on a Reversi/Othello game using QT and have got stuck when trying to implement a new game function which will return the game state back to its original state. reversigame.cpp [CODE]/** @file reversigame.cpp @author Rob Charrett @brief ReversiGame implementation. */ #include "reversigame.h" ReversiGame::ReversiGame(QWidget *parent, Qt::WFlags …

Member Avatar for BobC22
0
181
Member Avatar for YeMiller

Hi there, I'm getting on pretty well with a project for uni I've got to do, although I'm currently slumped at a bit. I'm running a loop to constantly read numbers into a set of equations and I'm required to output these to an excel file. I've sussed making the …

Member Avatar for YeMiller
0
596
Member Avatar for Dex02

Hello guys I am making a speel check program in Turbo/borland c++ and i have a problem with the libary #include <vector.h>. Is this labary in Turbo/borland c++ difrent or what? Here is the program: [CODE] #include <iostream.h> #include <fstream.h> #include <vector.h> #include <string.h> vector<string> explode( const string &znak, const …

Member Avatar for Dex02
0
137
Member Avatar for Mz3g

Hi guys, I'm doing a program that reads from two files and write to 16 files. The idea of the program is to rout packets across a network that contains 16 nodes. I still working in the routing mechanism but I just wrote the codes for the source node and …

Member Avatar for daviddoria
0
186
Member Avatar for gorgey506

[CODE]// Word Jumble // The classic word jumble game where the player can ask for a hint #include <iostream> #include <string> #include <cstdlib> #include <ctime> using namespace std; int main() { enum fields {WORD, HINT, NUM_FIELDS}; const int NUM_WORDS = 5; const string WORDS[NUM_WORDS][NUM_FIELDS] = { {"abbott", "part of colton's …

Member Avatar for Grn Xtrm
0
162
Member Avatar for duke.tim

okay so I am having an error with the code below and don't really know how to fix it, according to what I've looked up it should be right. I am using g++ on a linux system. (P.S. i'm a newbie ) okay and the error is: random.cpp: In function …

Member Avatar for duke.tim
0
706
Member Avatar for Jfunch

I'm suppose to write a program that asks the user to enters numbers which will be stored in a dynamic array. Then once they enter their first set of numbers they are asked whether they would like to enter another number or remove a number from their list. You can …

Member Avatar for tetron
0
146
Member Avatar for hellskier

Hello, I have a little program that needs to get data from two separate .csv files for afterwards parse them and translate info to vectors. Everything works fine when I am working with just one file (so just one ifstream), but when I try to use another ifstream to read …

Member Avatar for hellskier
0
176
Member Avatar for mks200

ok im kinda stuck in this homework, i dont know where to go next, please help me i need this done soon! heres the problem Your swim school has two swimming instructors, Jeff and Anna. Their current schedules are shown below. An "X" denotes a one-hour time slot that is …

Member Avatar for thomas_naveen
0
413
Member Avatar for close_encounter

I'm brand new to C++ and I'm having a difficult time. I'm working on a project for school and I'm very confused with functions all together. How do I get my arrays from main so I don't have to have them in each function and how do I call each …

Member Avatar for Banfa
0
139
Member Avatar for zemly

Hello, I have to make this programe. Please I need some tips and help to accomplish my objective. Please give a sample sketch. Must guide me.... [U][B]Problem Statement: Exchange of currency rates[/B][/U] You are required to write a program for Currency Exchange rates. User will have three options i.e. Pakistani …

Member Avatar for jwenting
-2
106
Member Avatar for red999

After tackling with this function for almost the whole day, I still cannot figure out why this code isn't working. My BTNode has three pointers(left, right, and parent). I went through this code on paper and it seems to work fine, but it does not work fine during execution. I …

Member Avatar for red999
0
129
Member Avatar for cproud21

I have created the following code to act as a buffer between two threads. I am trying to add support to handle empty and or full buffers, and am not sure how to address this. Would it be done through condition variables? Thanks. [CODE]#include <stdio.h> #include <pthread.h> #include <unistd.h> //for …

Member Avatar for vijayan121
0
237
Member Avatar for kodera

This is just the beginning of my name sort prog... I am starting with just reading in the names and then outputting each name... As of right now, it is crashing after displaying the first name... I think it's something with my array.. rectangular, instead of square, but don't know …

Member Avatar for jonsca
0
70
Member Avatar for timbomo

I cant seem to figure out why this program wont write to a .txt I commented out the meaning of each step and it looks like i am doing everything correct. If i can get it to write it and goto the following steps. [CODE] float price,curr_total=0.0; int itemnum, wrong=0; …

Member Avatar for VernonDozier
0
134
Member Avatar for timbomo

[QUOTE]in the files in_stream2 and 4 they wont open correctly but the rest of them will and i cant move forward until i fix it. i dont even no where to start when trying to fix it could someone help?[/QUOTE] [CODE]ifstream in_stream; // reads itemlist.txt ofstream out_stream1; // writes in …

Member Avatar for timbomo
0
120
Member Avatar for Danny_501

Hi all, i am trying to get an address from a user but when the program gets to the street i have an issue where the intended input i would like is: "big St" but this causes the cin /getline function(have tried both) to write it into the next input …

Member Avatar for Danny_501
0
86
Member Avatar for Hidden_mistakes

Hi i am trying to create a racing game and at the moment i have keyboard input which moves the player around at the same continous speed. I am wanting it to speed the player up however the longer you hold the key down for. Any simple way i can …

Member Avatar for Hidden_mistakes
0
103
Member Avatar for xcarbonx

Hello, i am currently working on a grade program that displays the student name, id #, and 2 grades. I have to read each of these categories off of an input file which should look like the following for at least 20 students.: EX: Jack Smith 450654333 95 89 The …

Member Avatar for xcarbonx
0
126
Member Avatar for ahmed hefnawy

How can i make user enter any numbers and can make all operation on them and provide him with() like: (9+3)/(-3*4) i wanna a solution please thanks

Member Avatar for Ancient Dragon
-1
73
Member Avatar for Elenaser

Hello, I am currently trying to write a program that will display a chart for the inventory of a car dealer. Here are the major points of the assignment, the ones Im having trouble on: Write a program to be able to display the instock table as instructed below : …

Member Avatar for Elenaser
0
186
Member Avatar for crodriguez08

Hey, I'm pretty much almost done with this program, but I'm not sure how to clear a previous file (after opening it) in order to open a new one. My program is supposed to open a file with a maximum of 100 unordered decimals and allow the user to sort …

Member Avatar for crodriguez08
0
105

The End.