Beginners - December 2014 (Page 10)

by rko786
need help
 
#include <stdio.h> #include <math.h> int main() { int i, n; float x, val, sum, t; printf(" Enter the value for x : "); scanf_s("%f", &x); n...
[7 replies] Last: yeah bit am getting an external error (by rko786)
by Nyck
Question about vectors
 
Hello. I had this assignment in which the user has to input some numbers which will be stored in a vector and the program has to tell you when you input the sma...
[3 replies] Last: The algorithms library has std::all_of , std::any_of and std::none... (by JLBorges)
Visual studio slow compile time
 
I have written a hello world program and it takes about 6 seconds to compile. Is there any way to make the compile time smaller? Code blocks take no more than a...
[1 reply] : Anyone? (by Hashirama senju)
I can't open a file outside the project directory
 
I'm trying to open a text file on the root of my C drive, but it won't open it for some reason. int main ( long argc, char *argv ) { ifstream file_in; ...
[4 replies] Last: And Windows does understand forward slashes used in its API. So use ... (by MiiNiPaa)
by Balux
Interactive coding platform for newbies
 
Dear all! I am currently reading C++ codes that I find difficult to fully understand. What I am looking for is a simple text editor/helper with the followin...
[no replies]
by GaryDT
Class & Function Template Comparison
 
My question is: When a variable of type int* is passed to the function template, T becomes int and not *int. When instantiating an object using type int*, T d...
[5 replies] Last: Very cool. Thanks again :) (by GaryDT)
Help with functions to convert 24-hour notation into 12-hour notation
 
Hi, would someone mind taking a look at how this could have been done better? Someone mentioned to me " You should be careful about passing hours and minutes by...
[2 replies] Last: Remember, when you're converting 24 hour notation to the 12 hour notat... (by deathslice)
Error message looping/ doesn't react properly to correct value
 
Hello, First off I am VERY NEW to C++ as well as this forum so please forgive any mistakes or missteps in procedure or format. I am working on an assignment ...
[11 replies] Last: BY JOE I THINK I GOT IT! lol I kept moving things around until I fin... (by Cherilyn)
Multicycle datapath
 
i believe i done 'A' correctly but don't even know where to start for 'B' A. Add the jal instruction to the multi-cycle MIPS implementation. B. Consider...
[no replies]
by Suixle
Can You Go Without Brackets?
 
Question, is: while(true)if(2==2)cout<<42; The exact same thing as: while (true) { if (2 == 2) { cout<<42; } ...
[2 replies] Last: OK, Thanks, I guess that's the part that confused me! (by Suixle)
Possible memory leaks
 
Hi all, I trying to refresh some of the concepts I learned using pointers. The program I have below works as the way I would like, but I am looking to see if th...
[2 replies] Last: Thank you pnoid. I will definitely look into this. (by mlholder)
Combination Generator Help
 
Hello, I coded a program to generate combinations of a string using the numbers 0 thru 9 and characters A thru Z and then have them written to a text file. T...
[9 replies] Last: Cool. Thanks, its working like I want it to now. I appreciate the help... (by chris84770)
Verify correct usage of malloc and free.
 
Hi I am following the Stanford programming paradigms series. We have a function (that works) for a generic swap. void a_swap(void *vp1, void *vp2, int size) ...
[2 replies] Last: Thank you for you input. The series (video lectures) is getting into h... (by Bdanielz)
by erfa4n
Generates a random number
 
hello my friends i have a problem with generating random number. i wrote this program #include "stdafx.h" #include <iostream> using namespace std; int ma...
[5 replies] Last: why should we do it? It's your code. (by jasonwynn10)
works with nano but not on xcode, hmm..
 
so this is my first while loop, i dont understand why it wont actually run after it builds in xcode.. the build is always successful but there is never any outp...
[1 reply] : Runs just fine on my machine. In xcode. You might try and open and run... (by Bdanielz)
by ianh83
Simple question regarding type conversion.
 
This is quite basic regarding converting types. Can someone help me understand the difference between these two statements assuming x1 and x2 are of type DOUBLE...
[3 replies] Last: Thanks for the help (by ianh83)
by Nebur
When declaring a priority queue, how to specify the "sorting" function?
 
Hello, I want to declare a priority queue of pairs of integers. Now i want it to be sorted in a specific order, it is not enough with great<> or less<> ho...
[2 replies] Last: Thanks kind sir! (by Nebur)
stoi is not a member of std?
 
I am using code::blocks version 13.12 and tried to compile this code. #include <string> int main(){ std::string s = "42"; int i = std::stoi(s); } It...
[18 replies] Last: Ok, I got visual studio professional and Visual assist X trials, and I... (by Hashirama senju)
by Stolle
SFML white taxture while loading from array(works without the array)
 
Hello! So I'm getting a stange error when I'm creating a array from something I call "Obstacle", the problem I'm having is when I'm trying to load the array(...
[3 replies] Last: At a guess, your Obstacle class has inadequate copy constructor and co... (by cire)
by Apac
Keep geting return code 255
 
I keep geting return code 255. // Hidrostatic Pressure Calculator #include <iostream> #include <sstream> #include <string> using namespace std; c...
[3 replies] Last: Although main() returns an int, that doesn't mean that the operating s... (by dhayden)
December 2014 Pages: 1... 89101112... 55
  Archived months: [nov2014] [jan2015]

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