49,761 Topics
| |
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 … | |
[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: … | |
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 … | |
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> … | |
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, … | |
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 … | |
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; … | |
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) .... }; … | |
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 … | |
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 … | |
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 … | |
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 … | |
[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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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; … | |
[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 … | |
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 … | |
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 … | |
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 … | |
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 | |
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 : … | |
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 … |
The End.