General C++ Programming - September 2014 (Page 23)

by Fringe
User defined arrays
 
I'm trying to write a C++ program that reads user values into two arrays, the user however first enters the number of integers to be read. The program then perf...
[2 replies] Last: Thanks. Yeah the answer, 'values', was right in front of me. Program r... (by Fringe)
data / picture manipulation
 
I have black and white picture which looks something like that. 0000000 0111111 0011111 0001111 0000000 I am looking for a method such that i can frame the e...
[2 replies] Last: How would you check around it, It seem stupid to have 10 if - statemen... (by DrJones)
reading a .pgm file
 
Hello eveyone, I want to know how to read a .pgm file from my hdd and store it in a 2d array so i can perform some action on the array later on. This is ...
[3 replies] Last: r u chinese? (by csstudent123)
Binary file and structs
 
Hello. What is the difference between reading from binary file between the following way: struct aStrct{ int number; }vars ; while(file.good()) ...
[2 replies] Last: pls explain which ones? I used the second one in a code and it is work... (by csstudent123)
Discussion: Global vs Local Variables with the Same Name
 
I have what I think is an interesting question. What would be the ouput of the following code? globals.h: int test = 0; main.cpp: #include <ios...
[1 reply] : Do all C++ compilers allow this code? Do you mean in actuality or in ... (by helios)
C++ Input from txt file size problem
 
Hello guys. I finally accomplished what I'd asked for earlier. I'm able to input data from txt file to c++ array. the Text file contains around 60,000 ...
[2 replies] Last: Use a std::vector or std::decque instead of an array allocated on ... (by cire)
editing attribute values with libxml2?
 
Hello everyone! I am sorry to bug you, but this site is my last hope. I have tried googling, so, reddit, irc, and various other forums. Anyways, I am writing a ...
[3 replies] Last: [quote=Little_Bobby_Tables]did you edit any of the code? Nope. Also, c... (by norm b)
by azad90
Modify element in node of linked list with value assignment
 
Hei guys, hope that you could lend a hand to solve this problem I tried to modify staff name with an assignment value of other string but couldn't work it ou...
[3 replies] Last: Never mind.. Now, I understand. Thanks a lot keskiverto (by azad90)
Convert file to base64? (confused)
 
I'm looking to convert audio, images, video to base64 in c++, and through many searches on the web I've only seem to come up with string > base64. When I vie...
[6 replies] Last: Thank you so much modoran! I looked up the read and write functions an... (by jonah876)
Understanding (int*), casts
 
I can't understand pointer casts ( C Style ). Implicit casts are next, but C pointer casts don't make sense to me. What does this mean (int*)&var or (char...
[8 replies] Last: Thanks for the help helios :) (by dominover)
Precision Errors
 
solved thank you
[3 replies] Last: Oh, yes. That thingy. const int internalprice = static_cast<int>( 100... (by keskiverto)
My asterisk diamond is printing out wrong.
 
I feel as if I'm so close and I'm just messing up a value somewhere, but I am at a loss as to what I should change. Here is my code: #include "stdafx....
[2 replies] Last: //#include "stdafx.h" // CHANGE ************************************... (by closed account 48T7M4Gy)
Duration of Temporaries in C++
 
My doubt is regarding the early destruction of a class object. Usually the destructor should be called at the end of scope in which its constructor was called. ...
[4 replies] Last: Thanks for your kind replies and for explaining the copy elision conce... (by sahilkakkar22)
Keep Getting 0$ as result???
 
I made a program for this problem= Each employee of a company contributes 6% of his salary towards his retirement account each month. The company will also make...
[5 replies] Last: @cire thanks man !! got it now. (by nauman123)
Fastest comparison algorithm based on a predefined container? (1,2,3)
 
Suppose you have defined a container of elements and you want do define a comparison function between elements based on the ordering of the elements in that con...
[49 replies] Last: [quote=prestokeys]Why is the course free? Enjoy it while it lasts. T... (by Smac89)
Better way for HTML parser?
 
I know my html parser is a hacky mess so does anyone have any advice on how to write a parser more efficiently. Here is the code: http://codejaw.com/8xkvhh
[2 replies] Last: I said write, I want to learn from this (by danielmccarthy)
GNUPLOT HELP
 
Ive just installed cygwin and im having some problems with gnuplot i have the terminal type set to x11 but ive tried png and a few other. With x11 i get the ...
[1 reply] : That is not a C++ question. Websearch returns stuff like: http://www.... (by keskiverto)
C++ Problems
 
Can anyone spot what wrong with my code here? I got problem with the loop and Q(remains same = Q1 in output). How to make the random number to be different fo...
[6 replies] Last: yaa.. i want to say that it's at the origin. (by sya0524)
Mandlebrot Is Only a Circle, whats the problem?
 
hi, its 2:24 am, and im sad and tired, i gave up, here's code (I use Qt for drawing) #include "mainwindow.h" #include <QDebug> #include <cmath> MainWindow::...
[4 replies] Last: thanks norm, but today while waiting for answer i decided to remake th... (by kam hagh)
by F40R
Rectangle Help
 
Hey guys, I'm having a bit of trouble here. I am trying to create a rectangle generator using - and |. However, when I run it, I enter the length and width and ...
[no replies]
September 2014 Pages: 1... 2122232425... 28
  Archived months: [aug2014] [oct2014]

This is an archived page. To post a new message, go to the current page.