Beginners - June 2016 (Page 13)

why can't assign an int on the heap
 
I don't understand why this isn't valid all I'm doing is setting aside memory from the heap to an int. int b = new int; or int b = new int...
[1 reply] : new always returns a pointer to the space allocated on the heap (oth... (by AbstractionAnon)
by Nefeli
rand() not printing correct #s for dice?
 
Hello all, I'm pretty new to C++. I've just done a ton of research to build a program that rolls 2 sets of dice 36000 times and then stores the different combi...
[1 reply] : First off line 15 is bogus. You're generating two indexes, each of wh... (by AbstractionAnon)
ASCII to numerical values gives negatives
 
Hi! I'm working on an encrypter, and am using ASCII to Numbers and vice versa to scramble letters / numbers, but the numerical values on occasion come out ne...
[2 replies] Last: Here's the (temporary) encryption/decryption algorithm so far. (it is... (by jlb)
New to C++, have an assignment
 
I have an assignment that requires user input of numbers into an array. Then I need to be able to search that array for a specific number, and output if the num...
[6 replies] Last: Thanks for all of the feedback everyone, definitely got it to work! (by kigoral)
return of main function
 
why main function always return int?
[1 reply] : From the creator of C++: http://www.stroustrup.com/bs_faq2.html#void-m... (by chicofeo)
Not operator trouble
 
So whenever I try to run this, it only executes the code in the if statement when a == b, which is the opposite of what I wrote. I've tried initializing a to 7,...
[4 replies] Last: You're welcome - glad it worked! (by MikeyBoy)
Console crashes when creating linked list class
 
All the code barring the "remove" function in LinkedL seems to work. When I try to remove a node from the linked list, the console crashes. Can anyone help me s...
[6 replies] Last: But I'm wondering how the dtor of node would look like because as you... (by coder777)
Linker Error
 
Error with code in DevCPP [Linker error] undefined reference to `Test::testfunc()' Error with code in Microsoft Visual Studeio main.obj : error LNK2...
[1 reply] : In test.cpp you have declared a function that is not part of any class... (by Peter87)
by FBHSIE
Help with execution
 
The final product is pretty big when I run it. I think something is wrong. Any help? //Ashton Dreiling //Monthly sales tax exercise #include <iostream> #inc...
[6 replies] Last: Thanks for the advice! (by FBHSIE)
Funtion pointer array in a class
 
Is it possible to build the functionality of the below code into a class object. I need to invoke separate instances of a function w/ different params simultan...
[5 replies] Last: another ? if I may .. how do you return the address of an array point... (by dbrenchley)
comparing an input with an array element
 
in my program, the user has to type in a name ex: Mary Peterson and the program has to run through an array where i stored the names, and find that name and...
[11 replies] Last: okay that format really helps, thank you guys! (by hibiscusleaves2544)
IDLE for C++
 
When i was studying Python there were IDLE that allowed me to see the result of my code right in the same window. Is there something similar for C++?
[4 replies] Last: If what you are looking for is an interactive C++ interpreter: https:/... (by JLBorges)
crashes when trying to print vector
 
so the code compiles fine and runs like it should but when I select 5 in the program to print out the bill it crashes why is it doing this? there is a few co...
[4 replies] Last: Line 54: You call printGeetings with 5. Line 148: You try to refere... (by AbstractionAnon)
Writing a Code to Test Other Codes
 
Is it possible to write a function that is able to run or build other .cpp files––whether through having the code open the files or using fstream to convert...
[1 reply] : google "Fourth generation language" (by closed account 48bpfSEw)
exact same code won't work
 
I'm to find the smallest index of where a number is at in a for loop but it just won't give me the output I want,YET when I used the exact same code yesterday f...
[12 replies] Last: @Abstract You're right ... but now fixed the way I intended (by closed account 48T7M4Gy)
Can't link cURL with MinGW
 
Hi I'm trying to compile cURL with MinGW (G++-), but it ain't working. This is the G++ command I'm using: g++ c:/users/5tif/desktop/example04.cpp -o c...
[3 replies] Last: Shouldn't you be linking to curlpp? (by kevinkjt2000)
by Revanl
sorting arrays
 
Hello. I made a simple program to collect data and print it but I have no idea how to sort my data in an alphabetic list (a-z) or by numbers(0-max number). Can...
[4 replies] Last: This worked . Thank you (by Revanl)
by FBHSIE
Homework advice #2
 
Hello, I was reading how to properly use constants better by the management team at my school. Though, I didn't understand some of their wording, so I was h...
[7 replies] Last: did my questions not make sense? Not really but I'm beginning to see... (by closed account 48T7M4Gy)
Stack Memory Corrupted?
 
Hi! I am using an array to store some characters, but I get this error: Stack around the variable 'output' was corrupted Here's the code: str...
[2 replies] Last: Okay, I'll set index to 0 instead of -1 (by Sporech)
by FBHSIE
Please help with homework.
 
Please help hint what to do. I have no idea how to fix these mistakes. http://prntscr.com/bfp0d0 http://prntscr.com/bfp0fm
[2 replies] Last: #include <iostream> #include <stdlib.h> using namespace std; //mod... (by integralfx)
June 2016 Pages: 1... 1112131415... 25
  Archived months: [may2016] [jul2016]

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