Beginners - January 2015 (Page 30)

struct operators
 
which operator is more advantage in struct?, object->dataMember; or (object*).dataMember ? ,or are they the same in speed and preciseness?...
[2 replies] Last: you mistyped your second example okay thanks. So they are both equi... (by xenovia12)
Finding the month with the highest total rainfall
 
How do you find the month with the highest total rainfall using stdio.h in c? #include <stdio.h> January = {5.0, 0.3, 0.2, 0.0, 1.2}; February = {6....
[6 replies] Last: Thank you so much! Finally manage to find the highest total rainfall. ... (by darkmage06)
by Lemmon
Dividing integers.
 
I have some code that goes through some steps (Very specific).Essentially it comes down to assigning x to be x/y. X and Y are both integers so when they divide,...
[1 reply] : Try something like: int x = 5; int y = 2; double z = static_cast<dou... (by jlb)
by lays
What if integral meet float point? type conversions.
 
Books don't say more about when integer meet float. cout.setf(ios_base::fixed); float f = 0; unsigned long long ull = ULLONG_MAX; f = ull; cout << f <...
[1 reply] : When an integer is implicitly converted into a float, its value is rou... (by Cubbi)
by sambos
binary files / reading specific lines
 
Hi. My program stores / writes text data to file. This data is also read by the program and by another 'administration - type' program. The data is written to ...
[5 replies] Last: Hi again, I've had some success today after having a day's break. Wit... (by sambos)
by lays
What does this mean? A exercise from C++ Primer. (someValue ? ++x, ++y : --x, --y)
 
due to the precedence and associativity, the ?: operator is higher precedence than the comma operator. comma is left associativity while ?: is right. The exe...
[4 replies] Last: Yup. Nice catch! (by Duthomhas)
by Torm04
Monkey Assignment Help
 
Hello, I am having problems with this assignment I was given in my C++ class. I'm going to just go ahead and type what the exact question is because I am at a l...
[1 reply] : Do you know a "2D array"? Do you know a "nested loop"? (by keskiverto)
utf
 
i i would like to know ohow I can proceed to the bits of the utf according octet. i that : int binOtect(string result){ string octect; if(binTod...
[2 replies] Last: Thanks for your answer ! Yes, I converted my “string” into binary... (by closed account GvMiNwbp)
Else Statement not Running
 
Hi. I'm starting my C++ 2 class this coming semester. I figured I would play around with some basics to review before starting. I made this super basic applicat...
[10 replies] Last: if (studentGrade > 89) all greater than 89 is true else if (studen... (by xenovia12)
by alexBB
How to get rd of hidden characters in source code?
 
I copied a cp p file from the web and tried to compile with g++ in Ubuntu. It gave me a number of compile errors related to hidden characters I don't see. I no...
[15 replies] Last: Thank you again, computergeek01. It bothers me that so much code poste... (by alexBB)
(C++) Read numbers from text file
 
I have a text file that looks like this: 1 2 3 4 5 6 I want to read this numbers and put them into a vector. How do I do that?
[1 reply] : 1. Define a vector (see Cplusplus.com Reference for Container). 2. Ope... (by tcs)
by awilds
Running a program from the command prompt
 
Whenever I run my program in VS 2010, it runs fine, but I get an error ("...exe has stopped working") when I run it from the command prompt. If I have other lib...
[1 reply] : Some IDEs forces stack and or heap memory initialized to zero when lau... (by tcs)
Compile OpenGL window
 
I am following the tutorial: http://www.opengl-tutorial.org/beginners-tutorials/tutorial-1-opening-a-window/ for making a window using OpenGL in Xcode. I am i...
[1 reply] : Either grab the 64-bit versions of the glew libraries and .so's or com... (by Computergeek01)
Lambda expression as binary predicate for a map
 
Firstly, sorry if it is not proper forum, but I feel like it is still a beginner thing, if it is not, then I apologize. Recently I've learned about how lambda ...
[2 replies] Last: Thanks for your help and also the links, guess I haven't been able to ... (by maciej53)
by bgmnk
Calling Functions
 
Say I have a function that I have created that was to run a mathematical equation to find a certain number as follows: int doStuff(int theBeginningNumber) ...
[5 replies] Last: Enable C++11 mode. Compile with -std=c++11 and these too: -Wall -We... (by JLBorges)
by h4ever
How copy binary data to string of type char*?
 
Hi, I try to solve this problem very long. I just cannot solve it what I do wrong. I have stuct FILES and its member program is type char*. I created "insta...
[8 replies] Last: Ok, so I added this code: printf("test:%d\n",files .program ); // 0 p... (by h4ever)
by Atton
Putting the value of two integers together
 
I have a question how would it be possible to put to integers together. So for example lets say the had the number 1 and the number 2. If you where to add the ...
[3 replies] Last: If this is not homework: #include <iostream> #include <string> int ... (by JLBorges)
by N3R
Console Application Advice
 
Hi all, I'm new here and new to C++, probably spent two weeks learning through things and have tried to make my own console application from the ground up as...
[4 replies] Last: Thanks! (by N3R)
Random array without duplicates
 
I want a random numbered array, I thought this should work But the array still displays duplicates. However if I put cout something instead of continue it print...
[2 replies] Last: Thanks for the point, problem solved. (by rjghoul)
January 2015 Pages: 1... 2829303132... 39
  Archived months: [dec2014] [feb2015]

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