49,761 Topics
| |
Hi, all. I'm pretty new to C++, and I think I'm getting the hang of it, but there's a problem with a program I'm writing and I just can't seem to fix it. The program's supposed to print a pyramid like this: [ICODE] 1 1 2 1 1 2 4 … | |
The C++ [i]string[/i] type can be converted to a [b]const[/b] null-terminated string using [icode].c_str()[/icode] for interoperability with legacy C code. However, this poses a potential problem when mixing [i]std::string[/i] with functions designed to mutate a string in-place. a const_cast to get around this issue results in undefined behaviour, since the … | |
Hi, I am trying to render irregular polyhedra composed of multiple closed polygons: each polygon i comprises a plurality of points j having the same z-coordinate. The points are not sorted within the polygons. The polygons can be convex or concave and are sometimes split(by having multiple closed polygons for … | |
hello Everyone, I have a problem with type casting. My code is [CODE] zcpr.next_in = FilePtr;[/CODE] next_in is a element of the zcpr structure where its type is and FilePtr is a void type pointer. zcpr is a z_stream type structure and next_in is a Bytef type pointer. This code … | |
I need simple timer that should not mess with the threads,and doesnt use Sleep(). I need something like this: [CODE]int main(){ function1 { whule(1) { // do stuff execute evry 30 min function2(); } } return 0; }[/CODE] So function1 and while(1) must not be slowed down and need to … | |
Hi, When I want to run a simple project in NetBeans, I receive an error : [quote] ! was unexpected at this time. c:\MinGW\bin\make.exe: *** [.validate-impl] Error 255 BUILD FAILED (exit value 2, total time: 219ms) [/quote] My eclipse is working properly with this MinGW installed on my computer . … | |
how division by using repeated subtraction by using recursion method? | |
I am trying to render multiple scenes in different window. I am confident that the data is correctly read in from the .txt file and used to initialise the Beam and Segment objects (each Beam object comprises >=1 Segment) However when I attempt to render the scenes the program tries … | |
hi everyone...... am right now working on a project which needs to connect to vlc player from code....does libvlc support this or else if there is any other please let me know...... my another doubt is there any possibility(like any available APIs) that takes video file as an input and … | |
I want my program to recognize tags, comments, and links in a html file. How would I get the program to read and count what I'm looking for? For example, if the html file has three links, how do I get my program to count it? Also, how would I … | |
I have << overloaded to write to a file, however I get an error when I try to use it in main. I tried calling the actual write method. Is the SpareTable that operator that is failing. I already checked the .h and .cpp parameters and that all my #includes … | |
Hi guys.. In the huffman algorithm I have made an output file contain 0 and 1.. how can I say to compiler that these 1 and zero are bit no Byte. and how can i make the real Huffman output that its size is lesser than the initial file, What … | |
/*O.k. I am down to a few less errors. I do not understand how to correct them, I have placed the ";" everywhere and it does not make a difference, in fact I get more errors. Still confused! Thank you. Here it is again. This is a program that processes … | |
hey, i was writing this program for complex number calc and when i run it ,it never returns me the right values.. so can u plz make necessary changes where i m wrong.. YEAH AND ONE IMP THING TO TELL U I M BEGINNING WITH POINTERS AND I LITERALLY SUCK … | |
We are all tired of from our daily lives. So I suggest to sit back and play this game. I present here a hangman game( text version ) for your enjoyment. There might be some bugs as I haven't throughly tested it, so sorry if you find it( I'm sure … | |
I've been trying to make a synthesis game for my Organic Chemistry class, but when I try to draw some buttons on the screen I get a segmentation fault. I am using some functions for loading taken from Tim Jones's tutorial. I have built a Button class that has the … | |
explain what is the use of vector , lines.size and lines.push_back functions #include <iostream> #include <fstream> #include <string> #include <vector> using namespace std ; int main() { ifstream file( __FILE__ ) ; string line ; vector<string> lines ; while( getline( file, line ) ) lines.push_back( line ) ; cout << … | |
Hey, my friend and I made this website: [url]http://www.letslearncpp.forumstech.com/[/url]. This website is complete with text and video tutorials made by my friend and I. Please visit this website and join it if you want to. Thank you. | |
Hi, i have a program that runs a loop during that loop if the user types lets say "status" i want a status report if the user didn't give any input no status report should be displayed i played around with getline getchar etc but those wait for user input … | |
I'm having issues doing this assignment. I'm not really sure what's wrong, so hopefully someone can help HERE'S THE CODE[CODE] #include<iostream> using namespace std; class Vehicle { private: int Age; protected: float Price; public: Vehicle(); ~Vehicle(); void setAge(int i) { Age = i; }; void setPrice(float i) { Price = … | |
hello c++ pros, iam a c++ beginner please help me with this code..iam unable to get the proper out put.In the above class i have tried to imitate String class and overloaded few operators. I got strucked up as show() method above was unable to print "t3" string properly.Please help … | |
:-/ Now, I'm trying practice on c++ basics, since few minutes I tried practice "for loop" especially, in console screen, I wrote this trivial program to calculate sin angles between angle (0 to 90) with for loop, but when i build it, it gave me one result like my attach … | |
Hi all, I have tried to make a little example of a random number generator for c++. However, as I am quite new in this language I do not know its peculiarities. Here is the code [CODE] //g++ -o ran ran.cpp #include <iostream> using namespace std; int main () { … | |
Consider the following program and input file: [code] #include <algorithm> #include <cstdlib> #include <ctime> #include <functional> #include <fstream> #include <iostream> #include <iterator> #include <string> #include <vector> #include "natural_compare.h" struct natural_less: std::binary_function<std::string, std::string, bool> { bool operator()(const std::string& a, const std::string& b) { return natural_compare(a, b) < 0; } }; std::vector<std::string> … | |
Hey all, I have to program a method that is called makelist, and I'm not sure how to program it. If I already have a list in my external file, how would I grab the list from there? I was thinking of infile.get(char) and keep going until it reaches the … | |
trying to do input checking for an alpha character inputted where a numeric one is needed. I've implemented this function firstChoice() to allow a certain response is '2' or '3' was picked and then another certain response for anything other than '0 '1' '2' or '3'. I must add another … | |
i don't know how to make 1.6666667 to 1.6 only.. . please someone help me. . please! please! please! | |
I am 12, mad about computers and skateboarding, im an emo, i know it doesnt sound right that i like programming. anyway, i have started learning c++, only just! I would like to know first of all if it is possible that you can build your own operating system with … | |
Hi, I'm working on a C++ mini-project ( I'm having an unoriented graph for wich I have an admissible flow and I have to determine the minimal flow for it). Everithing works fine, it compiles and runs well (the code is below) but I'm using files to read input and … | |
Hi, While writing program for making a member function of one class a friend of another, VC++ is shooting two errors. The entire code is split across five files, 2 headers for two classes, 2 .cpp for the class members' definitions and 1 containing main() function. The headers are as … |
The End.