Beginners - May 2019 (Page 6)

How to find whether a very long integer(upto 10^18) is a prime number or not in C++?
 
While solving a problem in C++,the range of numbers(integers only) to be used are from 4 to 10^18.So i am confused as how to calculate whether a number is a pri...
[17 replies] Last: check out 7 MB of code + lib -- that's all? No, kidding ;) Thanks for... (by MikeStgt)
Help Me to remove Specific Data from the txt. FIle
 
PLS help me line 100 - 129 That part was suppose to delete a specific data from the text file i dont know what to do well on this code it cant delete data , ...
[no replies]
Passing array of structure to function
 
Hello everyone. Trying to pass array of structures to a function named ageprint to print names of students of age 14. Error in lines 16 and 18. Please help err...
[3 replies] Last: Thanks everybody for providing solutions. I just saw your replies and ... (by Beginner of C)
A problem in using getline?
 
Theres a problem when i choose the Choice B #include <iostream> #include <fstream> #include <stdlib.h> using namespace std; struct reserve { string nam...
[4 replies] Last: Let us say, we want to read a char (formatted input) and a string (usi... (by JLBorges)
by Ashh
Loop more than one time
 
Once we hve entered Y for individual subject and the amount of subject, the receipt wont come out and loop for one more time(how many subject to regiter) before...
[3 replies] Last: [ code] Loop me baby one more time! https://www.youtube.com/watch?v... (by Duthomhas)
Overload Constructor Errors
 
I'm working on a program for an idea I had. However, I ran into some errors I can't figure out regarding an object (for a class) and constructors. Errors: fun...
[2 replies] Last: [quote=Repeater] You cannot call a constructor on an object that has a... (by PiggiesGoSqueal)
by Ashh
Void
 
Is it possible to do void from a lot of nested if complicated c++ program?
[4 replies] Last: [quote=lastchance]How complicated would you like me to make it? I'm su... (by Enoizat)
read and store data into array
 
i think the void data is working properly. void readstorefile and void printArr aren't working -- i dont think now, i know how to create and print an array in...
[6 replies] Last: The data function is doing that from what I see. If the console should... (by zapshe)
Banking system
 
I've been trying to up my game by doing something a little more challenging by making a banking system. I just started this, but have a quick question. when I c...
[4 replies] Last: Alright I should be good now thank you! (by Deadweight77)
by Ashh
How do I stop do while in if statement from keep looping
 
How do I stop do while in if statement from keep looping? do { cout<<"\nPlease enter category ( PT3/ SPM ) : "; cin>>category; if (strcmp(category ...
[3 replies] Last: Like so: cin>>love; do { cin>>love; cout<<"I love physics"; }while... (by coder777)
check if a value is integer or float
 
I've to check if a value is integer or not. I've tried p == int(p), floor(p) == ceil(p) and then i manually did the floor value as p-fmod(p,1). Even though p an...
[6 replies] Last: Hmm, yes. I don’t remember the OP having that particular example... ... (by Duthomhas)
Is there an equivalent of 'substr' for integers
 
Hey guys, I was wondering if you knew a of an equivalent of 'substr' for integers. So for example, if a user input a credit card / debit card number and you wa...
[7 replies] Last: // Example program #include <iostream> #include <string> using namesp... (by MikeStgt)
by Ashh
Can do while can be used for twice in the same program?
 
Let's say I'm making a program for tuition class, I wanted to ask "Do you want to add another registration?"(the do while will be placed at the very outer of th...
[2 replies] Last: I would also use toupper or tolower for registration. Also, make sure ... (by gongong)
expected unqualified-id before numeric constant
 
I am following this tutorial page: http://www.winprog.org/tutorial/menus.html But in Eclipse I am getting the error: resource.h:1:20: error: expected unqu...
[4 replies] Last: .rc files are compiled by a "resource compiler" program, not the C++ c... (by dutch)
by pg1908
push_back error with vector of objects
 
I have a class roster whose main property is a vector of member class objects. But I am having trouble in making a method to add a new member to this vecto...
[7 replies] Last: If restarting VS is actually fixing things then the problem might be t... (by dutch)
optimize working code
 
hello! my code is working. I just need help optimizing it, e.g. make things shorter, more readable, etc. The main concern is if there's a way to optimize the fu...
[13 replies] Last: if all the strings have 3 letters, you could shove it into one string ... (by jonnin)
matrix chain multiplication
 
// See the Cormen book for details of the following algorithm #include<stdio.h> #include<limits.h> // Matrix Ai has dimension p[i-1] x p f...
[1 reply] : i is a loop counter and its role changes depending on which loop you a... (by jonnin)
sqrt(int) vs int(sqrt(real))
 
Every now and then I find something unsigned long long n ... unsigned long long imax = sqrt( n + 0.5 ); what to my understanding converts n to real, adds 1/2,...
[9 replies] Last: Whether that rounding affects square root is ... topic of this thread... (by MikeStgt)
while loop crashes after the 4th entry
 
I have created this code in which I am proud of to have gotten working on my own after expanding it from a tutorial, still I find that the console crashes after...
[4 replies] Last: yeah the cout << press ctrl+z I forgot to remove as one can just quit ... (by Unruffled)
reservation
 
Can somehow teach me the basic of fstream, and also how to make a reservation using that I plan to make a reservation that the list can be save into a txt fi...
[13 replies] Last: ANdy ANDYYYY ANDYYY HAHHAHAHAHHA TNXXXXXXXXXXXX thats help alot Hone... (by CoolAvocado)
May 2019 Pages: 1... 45678... 16
  Archived months: [apr2019] [jun2019]

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