
please wait
by k88
generating random numbers in an array without repetition
|
Hi,I was trying to generate random numbers to fill in an array but my code seems to not work. Here's my code: int n,m,num; cout<<"num"<<endl; ... |
Oct 2, 2018 at 6:41pm
[1 reply] : #include <set> #include <cstdlib> #include <ctime> #include <iostre... (by Repeater)
|
by shauryadan
Assignment Operator for class with struct pointer member variable
|
I am getting a bad access error when the code goes into the assignment operator. Not exactly sure how to write the struct pointer member variable in terms of sr... |
Oct 2, 2018 at 6:20pm
[3 replies] Last: These are ok: CSNerd::CSNerd( string name ) // but I prefer initili... (by keskiverto)
|
by w208395063
having problem with the this problem
|
Using C++ to: Handling Priorities with Linked Lists: Design a class called supportTicket that handles information about reported IT support issues. A ti... |
Oct 2, 2018 at 4:51pm
[1 reply] : std::list is a linked list. std::list has sort(): http://www.cplusplus... (by keskiverto)
|
by benjm
[C] Reusing pointer for new string
|
I was curious to know a good method to reuse a char pointer: char* strfunc (char *sp, int length) { if(!sp) free(sp); sp= (char *)calloc (length, s... |
Oct 2, 2018 at 4:48pm
[2 replies] Last: just reuse it? You appear to be overthinking something. step 1) allo... (by jonnin)
|
by rookie000
Circular Buffer
|
Good day! I'm a beginner in C++, and I'm currently trying to implement a (boolean) circular buffer. I would like to ask about getting the iterator of the begi... |
Oct 2, 2018 at 4:34pm
[6 replies] Last: Thank you for your detailed explanation. It's now clearer to me, and t... (by rookie000)
|
by davidjayce
Search and display the comparison
|
I need help with the following question, I don't want the whole code but I really need help with this section. (DISPLAY THE NUMBER OF KEY COMPARISON FOR EACH SE... |
Oct 2, 2018 at 4:24pm
[4 replies] Last: Do you mean the number of comparisons until a match was found? Like th... (by Manga)
|
by chrichri
copy elemnt in buffer
|
a program who copy just length of data which i need for example: data = b\nh\ne\nlength 45\n i need to copy only 45 in my buffer and then return the rest of my... |
Oct 2, 2018 at 1:55pm
[1 reply] : I have no idea what you ask. Can you explain with more detail? (by keskiverto)
|
by GoForBroke
Can't modify array with pointer
|
Why line 8 (marked with comment) doesn't change array? #include <iostream> using namespace std; int main() { int tab = { 1, 2, 4, 8, 16 }; ... |
Oct 2, 2018 at 11:59am
[2 replies] Last: Holy cow, I'm sory, my mistake - don't catch this assignment. Thanks a... (by GoForBroke)
|
by joaoeduardo
what(): std::bad_alloc error, what is that?
|
So, how can I fix this error? Here's my code: note that sizes =1239 and it's from a vector of objects. governador : cout << "Voto para governador (nu... |
Oct 2, 2018 at 11:17am
[1 reply] : Duplicate of http://www.cplusplus.com/forum/general/243443/ . DON'T c... (by MikeyBoy)
|
by LordOfPens
Nested Loops Help
|
My code is supposed to allow you to input all the inches of rain for the year, then adds them up at the end. when i run the code, i can only input januarys rain... |
Oct 2, 2018 at 8:10am
[3 replies] Last: holy crap i got it. i had the inputRainAmount as an int and was typing... (by LordOfPens)
|
by Tduck
Why am I getting a segfault?
|
My current assignment tasks me with using fstream, which I now finally understand to an extent, but now I have a problem which I haven't seen since I learned Py... |
Oct 2, 2018 at 7:49am
[3 replies] Last: Why is my code starting at line 10? ??? Please explain. Yes, your ... (by keskiverto)
|
by Verti
I need help with a project.
|
I'm currently taking an intro to computer science course in college and I'm having a lot of trouble thanks to having a horrendous teacher who teaches in the mos... |
Oct 2, 2018 at 7:15am
[2 replies] Last: You basically read from a (text)file like you read from std::cin using... (by Thomas1965)
|
by fivestar
calling function from class
|
Im trying to call a bool function called birth(int x, int d, int &v) in main. the function is in a class called GridWorld. Im havin trouble calling it. i... |
Oct 2, 2018 at 5:50am
[1 reply] : not much info is available from your code, what errors are you getting... (by closed account SECMoG1T)
|
by Stuffman
char/string ambiguity causing crash?
|
I'm getting an odd crash whenever I close my program that seems to be caused by a string not de-allocating itself properly. A bit of research indicates it ma... |
Oct 2, 2018 at 5:35am
[6 replies] Last: You haven't actually checked if your input is correct. I tested it and... (by poteto)
|
by rravelin
My program give me errors What is w
|
int main() { int fahrenheit; celsius; cout << "Please enter a temperature in Fahrenheit: "; cin >> fahrenheit; cout << fixed; cout << setprecisio... |
Oct 2, 2018 at 4:39am
[1 reply] : #include <iostream> #include <iomanip> int main() { double fahre... (by JLBorges)
|
by Awsom3Alan3
Need help with reading a text file and displaying it.
|
My objective is to read a text file that looks like this, 3450, Guido VanRossum, 10, 15, 14, 18, 20 6120, Yukihiro Matsumoto, 10, 9, 13, 12, 14 9230, James... |
Oct 1, 2018 at 10:27pm
[3 replies] Last: I see, Thanks for the help! (by Awsom3Alan3)
|
Const |
Hello. I am recently new to C++ and I was wondering what "const" does, and when I should use it. Thanks for answering! |
Oct 1, 2018 at 10:26pm
[2 replies] Last: When you declare something const, the compiler will enforce that promi... (by keskiverto)
|
Best selling items program |
Hi i am writing a program that will read a sales.txt file and output the top 2 items sold and their gross sales. unfortunately i can only get the program to out... |
Oct 1, 2018 at 9:52pm
[3 replies] Last: Im also having trouble with getting the first and second products high... (by Usm6rn)
|
explain fragment of code |
can someone explain how this code ends up with i = 5 i just dont see it. Ive tried messing around with it and noticed that when I change i to 4 the while stat... |
Oct 1, 2018 at 9:45pm
[2 replies] Last: Hello COOGSHOUSE713, the expression i / 5 evaluate to an integer becau... (by mycuser)
|
by Kiryu
Why does my exception skip the catch block and just terminates the program?
|
Considering the following int main() { try{ GLShader shader(); }catch(...){ std::cout << "Hah! Catched!" << std::endl; } ... |
Oct 1, 2018 at 9:13pm
[16 replies] Last: Taking a brief look at your code I noticed a memory leak, not gonna te... (by poteto)
|