49,761 Topics
| |
Hi All, I am tring to using the below function to read in a .txt file, which consist of a 10x10 matrix number. I just cannot find out where goes wrong, it appears such a funny number -858993460... [CODE]void readinput(int in[][MAXCOLS]) { int row ,col,ip; //Declare row,col, ip as int … | |
What is the difference between Release and Debug modes in Visual Studio while building a project? | |
Ok simple question. Google didn't bring up much and I need this. This is the question: How do I interact with non-text files in a simple console app? | |
i want to do a project using graphics in c++..i am going to start with a simple project, because i am a beginner.. plz tell me which websites to refer in order to get help on topics and to learn about graphics in c++.. thank you.. :) | |
why encapsulation voilate at the binary representation of any source code? | |
[code] void test_rr(std::string const &lvalue) { std::cout<<"this is lvalue"<<std::endl; } void test_rr(std::string &&lvalue) { std::cout<<"this is rvalue"<<std::endl; } int main() { test_rr("this is"); //will output "this is lvalue" std::cout<<"system pause"<<std::endl; std::cin.get(); return 0; } [/code] how could I treat "this is" as rvalue reference? The easiest way I could think … | |
I have been asked to implement airline Reservation Simulation system using Data structures as part of B.Tech Minor Project. I have good knowledge of C++ but none of Visual C++ (except how to draw forms). But we also need to implement UI. So we are thinking of implementing UI using … | |
Hello. I have a problem and I would love it if I could get some insight on it. I have read the forums with many answers about the subject, but I'm still having problems so I'm writing here. Basically I was following [URL="http://tom-shelton.net/index.php/2008/12/11/creating-a-managed-wrapper-for-a-lib-file/"]this[/URL] guide which is for creating Managed Wrapper … | |
I'm using Visual Studio 2010, Win 7, MS Access 2010, C++, Direct ODBC, 32 bit. The first SELECT statement executes. The INSERT, SELECT, SELECT and UPDATE statements don't nay help is appreciated. Thanks. [CODE] #include <windows.h> #include <stdio.h> #include <sqlext.h> const char* DAM = "Direct ODBC"; SQLCHAR szDSN[256] = "Driver={Microsoft … | |
Just wondering, how high can c++ really count? Because I made a fibonacci program, and it starts acting weird and printing negatives at about 10-11 places. With both long, and int variables? Is it impossible to count higher? If not, how? | |
I can not figure out how to go to the next line. In the data we read in number of test on the 1st line then student names followed by their test scores on the following lines. My problem is I can only get the first student and his average … | |
What I want to do is read a whole paragraph of text from a custom file. How would I do this without doing something silly like this? [CODE]while(someFile >> word1 >> word2 >> word3){ //etc. }[/CODE] I need to be able to read 3 numbers for todays date, then read … | |
Ok when I use gcc (all th time) the program it makes in c++ with debug on is around a megabyte when off it is around half a megabyte when working with c with debug on it around 50 k with it off it's at about25 k this doesn't seem … | |
[CODE] #include <iostream> #include <fstream> #include <string> using namespace std; string constestantName(istream &); void getJudgeData(istream &, string); void CalcScore(ostream &, string, double, double, double, double, double); double findLowest(double, double, double, double, double); double findHeighest(double, double, double, double, double); int main() { int loopnum, counter, nestcounter; string name; ifstream infile; infile.open("starsearch.txt"); … | |
I make a program that reads a file and then it stores the information in two char.The problem is related to the char Elements and symbol. What is causing errors in my program? Thanks in advance. [CODE]#include "stdafx.h" #include <iostream> #include <fstream> char* Elements;//The problem char * symbol; using namespace … | |
I have an assignment to create a file with number 1-20, and another one with numbers 100-5 decreasing by 5. I've got those two down, but then I need to multiply both those files together one by one and have the answer output to another file. ie: 1*100= 100, 2*95= … | |
[CODE]#include <iostream> #include <fstream> #include <string> #include <iomanip> using namespace std; string constestantName(istream &); //Calls the the input file from main() by refrencea and returns the name of the contestant void getJudgeData(istream &, string, int); //gets the scores from starsearch.dat and stores them in five veriables void CalcScore(ostream &, string, … | |
Hi, I have searched a lot of tutorials on how to make owner-drawn icon buttons, but a lot of them are a little bit hard to understand for API newbie and done in run-time, not with resources (I like resources!) so, can someone create/post some nice and simple tutorial on … | |
I'm trying to compile this simple dot program with C++ that uses OpenGL. I made a struct GLintPoint to hold just points x and y. It seems I didn't delcare the struct according to the errors. [CODE]#include <GL/glut.h> #include <stdlib.h> #include <time.h> struct GLPoint { GLint x; GLint y; }; … | |
[CODE]#include <iostream> #include <string> using namespace std; //char inventoryRequest = 'i'; //Function Definitions. void exitGame(); int playGame(); int main() { //Menu Text. cout<< "\t******Menu******\n\n"; cout<< "Please choose one of the following:\n"; cout<< "1 -Play Game.\n"; cout<< "2 -Exit.\n"; int choice; cout<< "Choice: "; cin>> choice; string name; switch (choice) { … | |
Hi.. this is not a "which is better" thread, although if you happen to have a reason for thinking so, please share your thoughts. First I just want to say that I do not want to have any flame wars or arguments or anything like that. Please keep emotional arguments … | |
hello people. how are you all doing? my problem is i have been programming in c++ for almost a year now but i have always used windows with microsoft visual studio and dev c++ but now i discovered that programming in ubuntu is much more fun couz it is way … | |
Hello everyone. I am having a problem with my program; it is supposed to read values from an input text file, put the data into a structure, then output the data from the structure into a binary file. The first 2 parts work fine, but I keep ending up with … | |
Hello everyone I am a college student learning c++ and I am not understanding why you put a "For loop" inside of another one. What advantage does it have and what can you use it for. For example: [CODE]for (int i = 0; i < 5; i++){ for (int g … | |
Hi. I have to write a program that solves the Knight's Tour in C++. The Knight's tour is where the Knight Chess piece has to move to every space on the chessboard only once. I am new to programming and I'm having trouble figuring out why my program has stopped … | |
I'm using the Win32 API to create a game, and I want to give the player as big of a field of view as possible. The problem is, with the game engine I've developed (from Michael Morrison's [I]Beginning Game Programming[/I]), I can minimize and close the program, but I can't … | |
i want to write an algo about stack example.. that is, ""When a person wear bangles the last bangle worn is the first one to be removed and the first bangle would be the last to be removed. This follows last in first out (LIFO) principle of stack."" how to … | |
Hi All, I am new to C++, I am tring to generate the random number from 0-99, and save it to a matrix array with the size of 10x10. Below is my code, the resule comes out funny. Can you help to see what goes wrong? [CODE]#include<stdio.h> //Header file #include<stdlib.h> … | |
Hey guys im trying to write a code to give me Arthimetic mean and standard deviation for 4 Integer values... i don't know what im doing wrong it's not letting me compile any ideas?? [CODE] #include <iomanip> #include <iostream> #include <cmath> using namespace std; int main(void) { int X1; int … |
The End.