49,761 Topics

Member Avatar for
Member Avatar for pearle

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 …

Member Avatar for tetron
0
122
Member Avatar for Bench

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 …

0
957
Member Avatar for bobsta

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 …

0
67
Member Avatar for blackmagic01021

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 …

Member Avatar for blackmagic01021
0
122
Member Avatar for suncica2222

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 …

Member Avatar for suncica2222
0
147
Member Avatar for Behi Jon

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

Member Avatar for Behi Jon
0
356
Member Avatar for neethumol
Member Avatar for jonsca
-2
40
Member Avatar for bobsta

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 …

0
72
Member Avatar for chinnaedu

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 …

Member Avatar for chinnaedu
0
113
Member Avatar for Specialafrican

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 …

Member Avatar for jonsca
0
93
Member Avatar for pinsickle

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 …

Member Avatar for jonsca
0
161
Member Avatar for moein_soltani

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 …

Member Avatar for moein_soltani
0
101
Member Avatar for AmigaCarolena

/*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 …

Member Avatar for EngSara
-2
140
Member Avatar for sleepybug

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 …

Member Avatar for jonsca
0
201
Member Avatar for mrnutty

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 …

Member Avatar for mrnutty
1
285
Member Avatar for caribedude

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 …

Member Avatar for caribedude
0
242
Member Avatar for Geetha Choudary

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

-4
42
Member Avatar for Hawkpath

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.

Member Avatar for Hawkpath
0
194
Member Avatar for MrYrm

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 …

Member Avatar for MrYrm
0
170
Member Avatar for MrJNV

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

Member Avatar for dusktreader
0
105
Member Avatar for srinath3

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 …

Member Avatar for jonsca
0
114
Member Avatar for iammfa

:-/ 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 …

Member Avatar for jonsca
0
117
Member Avatar for tikoti

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

Member Avatar for jephthah
0
470
Member Avatar for Narue

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

Member Avatar for dusktreader
7
2K
Member Avatar for kekekerush

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 …

0
57
Member Avatar for gnarlyskim

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 …

Member Avatar for gnarlyskim
0
438
Member Avatar for taggz19

i don't know how to make 1.6666667 to 1.6 only.. . please someone help me. . please! please! please!

Member Avatar for peter_budo
0
394
Member Avatar for josh06

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 …

Member Avatar for josh06
0
114
Member Avatar for 28daniela28

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 …

Member Avatar for 28daniela28
0
187
Member Avatar for mrinal.s2008

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 …

Member Avatar for Fbody
0
190

The End.