Beginners - September 2018 (Page 2)

how is this possible
 
Write a program that will display the words “This is it!” from a variablewithout assigning any characters to the variable. You cannot use cout << “This is...
[15 replies] Last: an integer is just some bytes. On my system a long long is 8 bytes, ... (by jonnin)
Adding digits of array values
 
Hey guys! I'm new to C++ and i was trying to understand how to work with arrays. The idea I have is 1) I wanted a user to input an array, the program to output...
[3 replies] Last: OK I understand now. Easiest would be to create a function int sum_of_... (by Thomas1965)
Dynamically updating arrays
 
So I know vectors are out there to solve this exact problem, but as a challenge would like to figure out how to dynamically update the size of an array as valu...
[1 reply] : you can't resize arrays. you can resize pointers: int * a = new int ... (by jonnin)
How to have an instance of subclass in the superclass
 
How can I declare my subclass and superclass in a way which: a) my subclass can inherit from superclass b) superclass have an instance member of subclass I fin...
[6 replies] Last: I made a mistake - that example is wrong. I meant something like this... (by mbozzi)
Guess number 1-500
 
Can anyone tell me where I went wrong? One error code says i can use the "break" because it's not in a loop but I though it was? And another issue im having is ...
[3 replies] Last: Thank you for the replies! (by tdknapp)
Division loop problems
 
I'm writing a program for my university that if the user input is between 10 and 45 (inclusive). It adds the sum of the numbers between the input and 10. Second...
[5 replies] Last: Thanks so much for the help everyone. I figured that my void function ... (by daltonphelps0)
segmentation fault(core dumped)
 
I am getting the error mentioned in the title question link- https://www.spoj.com/problems/HS12MBR/ #include<iostream> #include<vector> #include<algorithm...
[3 replies] Last: There's a few mistakes in your code. 1. You are trying to read lines l... (by tpb)
SDL_RenderCopy
 
Hi guys, not too sure if anybody here has dealt much with SDL,but I'll give it a shot, I'm wondering how the SDL_RenderCopy function works - https://wiki....
[4 replies] Last: thanks helios =) (by adam2016)
by AL88
Can anyone help explain these errors
 
^ /home/alistair/Codelite/AnIntroductionToProgramming/14_5/14_5/14_5/main.cpp: In member function 'void PartsList::Insert(Part*)::Par...
[8 replies] Last: Consistent indentation will help. Maybe begin using a tool like Clan... (by mbozzi)
by kbs96
Adding character sequence as a single consonant element.
 
I'm working on an assignment and I have to hyphenate the words in a c style string if they have a vowel-consonant-consonant-vowel or vowel-consonant-vowel patte...
[4 replies] Last: I am not sure you are 100% on the right track? (close, but some detail... (by jonnin)
Can anyone help sum of digits
 
Hello i want to sum digits in int can you help me? ok here is example: i have 6 digit number 123456 i want to sum 123 and 456 i want first 3 digits sum and la...
[12 replies] Last: True... And nice James Bond reference. :) (by Manga)
Swapping Elements/values in Arrays
 
First, I was given a pseudocode to translate it into c++ language Pseudocode sortArray() x = 0 didSwap = "YES" while didSwap = "YES" x = 0 didSwap = "NO...
[4 replies] Last: I think you should read the tutorial more carefully. Whole page. Furt... (by keskiverto)
How extract element from frame in c++11
 
I try to write a code which one extract the element eg: "\ndata1:gdfste\ndata2:abcdfe\ndata3:wertqw" affich data1 = gdfste data2 = abcdfe data3 =...
[1 reply] : A \n in stream is whitespace: #include <iostream> #include <sstream> ... (by keskiverto)
Merging Files
 
So my teacher had told me to translate a pseudocode into c++ program...I just want to know if the codes makes sense. Sorry if it's so vague.. #include <...
[9 replies] Last: I just want to say thank you so much to everyone for helping me out. R... (by kuushie118)
how to file handling
 
At least three western European companies showing here at Domotechnica, the world's largest fair for electrical appliances, expressed intentions of getting thei...
[1 reply] : You can use filesystem: https://en.cppreference.com/w/cpp/experimenta... (by coder777)
compiling
 
so the code compiles but as soon as i build it and crashes. i use geany for this. can someone explain what is happening employee.cpp #include<iostream> ...
[7 replies] Last: Well, it seems like you are supposed to set it up yourself, using a ma... (by Peter87)
by DeBary
help
 
I need help with this sample problem because a question like this will be on my test, i am so lost, can someone show me how you would even do this. Arthur, K...
[8 replies] Last: 1) When posting code, please use code tags to make it readable: http:... (by MikeyBoy)
C++ Language Bitvector Program to read in file
 
Can anyone create a small program that uses Bitset (Bitvector) and reads from a file. The program has to be in C++ and the hours and day are on the same line in...
[1 reply] : yes, many of us can do that, if you have a go at it and post your prob... (by Jaybob66)
Is it okay not to bother about the syntax of preprocessor?
 
For a beginner, is it okay not to bother about the syntax of preprocessor directives while learning to write C++ codes? I find online consoles each with a diffe...
[8 replies] Last: [quote=bagrarajeev]I could see only main() as the function. So, please... (by Peter87)
what
 
Write a program that will display the address of a float variable and another variable that shares the same address and value as the first variable. Do not init...
[12 replies] Last: Just so we know where the questions are coming from ... https://www.co... (by lastchance)
September 2018 Pages: 1234... 20
  Archived months: [aug2018] [oct2018]

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