General C++ Programming - June 2018

by helios
Object destruction/relocation while in member function
 
Am I right in assuming that causing an object to be destructed from inside one of its member functions will cause undefined behavior? For example, by enlarging ...
[1 reply] : delete this; can be done safely, so it's not automatically dangerous... (by Repeater)
Codechef LOC-Noob Chef And Katana Problem
 
Can anybody tell me what this question what to say?I read it 2-3 times,but did not able to understand properly what we have to do exactly? Chef likes to play...
[4 replies] Last: Yeah sure https://www.codechef.com/LOCJUN18/problems/NOOB (by closed account oG3kizwU)
Pointers
 
I'm looking for some help with a few of these ToDo comments in this program. I can't figure out how to copy release and create the line in this program. Any hel...
[2 replies] Last: This looks similar to some of the stuff I've seen. Thank you for the h... (by blinKAlliance)
Order variables alphabetically
 
Hi, we have a class project to slove linear equations, but first I have to print it in the proper form. if the user's input like this 3x2+2x1+4x3=16 it should...
[1 reply] : I assume 3x2 means 3x 2 . // Example program #include <iostream> #i... (by Ganado)
c-like Interpreter
 
I'm working on a program about graphs. That program for now can read, save graphs from and to files, allows to modify them at runtime (dynamic graphs). Later i ...
[7 replies] Last: Most embedded interpreters give you C/++ functions like typedef void... (by helios)
How to create "create new gameobject" algorithm
 
i have a gameobject class and what i want to do is when user pressed a button it creates a new gameobject while rendering existing gameobjects. Here is my main ...
[6 replies] Last: Kicking a dead horse here, but anyways: Listen, make sure you read al... (by poteto)
Encounter problem with my assignment about class
 
Here's my program below. It's a very basic program with class and separate header file and stuff. I don't know where I made a mistake but the program won't run....
[4 replies] Last: also why do you have: 2 private variables 4 public functions which set... (by barnack)
Problem with function
 
Hello everyone, I am working in the field of Computational Fluid Dynamics (CFD). I use to use FORTRAN for writing my codes. Now I decided to use C++. I am ne...
[3 replies] Last: It looks like you are confusing C++ arrays, whose indices start from 0... (by lastchance)
by StMick
How to speed up a programs runtime?
 
I am trying to solve a least common multiple problem where the user inputs 2 numbers and the least common multiple is returned to the screen. Does anyone have ...
[11 replies] Last: Solved! Thank you for your hints, Ganado. Didn't know that LCM (x,y) ... (by StMick)
DLL portability issues
 
I've built a small script in a scripting language to utilize a DLL written in C++ that utilizes the OpenCV lib. On the development computer it works fine. Po...
[2 replies] Last: No, I didn't, however what you said made me think further about depend... (by roger911)
functions: how return char* correctly? (1,2)
 
i always get the same problem for return char* on functions :( see these function(return the char* in uppercase way): char *convertToUpperCase(const char *sP...
[22 replies] Last: thank you so much for the correction. thank you to all (by Cambalinho)
Use libcurl to sign into webpage?
 
See both C++ and page source code below. I want to use libcurl to enter a username and password into the appropriate fields on the webpage and then click the su...
[2 replies] Last: You can use libcurl to log in to a secure website. Use the following f... (by david1223)
When will I need to allocate my data on heap
 
I understand what is heap from my older questions but I don't understand when will I need heap allocation. Can you explain with some examples ?
[10 replies] Last: Whether you know it at compile time or not, very large things usually... (by MikeyBoy)
by Ozzy69
What's wrong with my problem - Segmentation fault
 
Hello everyone, my program is not working and i dont know why! Appear this messenger to me "Segmentation fault". Help me please. File "matriz.txt": 7 1 6 2 0 ...
[1 reply] : Your dupe thread in the unix/linux section already has a reply that yo... (by poteto)
why do I get an extra operator?
 
Hi I was trying to implement a reverse polish notation,and it works but... here's the problem not all expressions are correctly parsed and they're duplicates...
[1 reply] : Nevermind I figured it out it's in the counter substr function. I need... (by stonedviper)
by Derex
Preciso de ajuda com um projeto pequeno em C
 
Tudo bem pessoal? Então pessoal, estou com um trabalho da faculdade! e estou precisando urgente de ajuda com um projeto! O código já está pronto! Probl...
[7 replies] Last: there is no global variable. struct is a TYPE, like integer. the var... (by jonnin)
What exception should I throw in the case of an incorrect file name?
 
I have this constructor that accepts a string for a filename. In order to verify that the file is accessible, I am using a std::ifstream to check if the file ca...
[15 replies] Last: If I don't check, and the file is NOT valid, the user might have to s... (by poteto)
ofstream and logging & multiple threads
 
Hi All, I'm new to this forum, but not new to C++. Doing this as of, I think 2005 or so, for a specific product, that still sells :) So, I'm trying to min...
[5 replies] Last: This is new to me. But I wonder how well this system works with cin an... (by poteto)
For every "new" must be a "delete"?
 
At least I thought so. But the professor at my college insists that if I allocate memory to a pointer: my_class * object = new my_class; And then stop ...
[15 replies] Last: That particular program may never run out of memory, actually. Some OS... (by helios)
Visual Studio 2010 Unit Testing in C++
 
I am trying to make a basic unit test for a very basic C++ class in Visual Studio 2010. I have already tested the class and everything works. However, when I ma...
[3 replies] Last: is your test project set up for something nonstandard like managed cod... (by jonnin)
June 2018 Pages: 123... 9
  Archived months: [may2018] [jul2018]

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