Beginners - July 2018 (Page 3)

reading words from file into string ?!
 
So I'm trying to read from an input file into a string, where each word is put into a separate element, and each word is seperated by a space, punctuation, or ...
[1 reply] : #include <iostream> #include <string> #include <vector> #include <cc... (by tpb)
an exercise by a begginer (true begginer)
 
Good evening from colombia to all. I am learning programming in c ++, and doing some exercises. Might you check this one?. Regards and thanks. /*Square of ...
[3 replies] Last: thank you two , the tips i will keep it in mind. Muchas gracias, (by luciusFernatore)
Hello World! And the console stays open. No fuss!
 
Took "Hello World" and used a simple loop to force the console open. thnx @manga for the advice! #include <iostream> using namespace std; int main() {...
[7 replies] Last: mbozzi: Agreed. Although I will add that TUIs are legit, if properly i... (by helios)
by apm11
My code doesnt work and its going to infinte! I am stuck :(
 
Why is this code not working and going to infinite? X is read and I must find the X prime number. Example: X=4 --- the fourth prime number is 7 and so on. Thank...
[2 replies] Last: THANK YOUU! You saved meeee! Thanksss again (by apm11)
Read more .txt files within a configured .txt file
 
Hi, I'm just learning c++ and really need your help to program as stated by topic. Basically, I have a text file called 'example.txt', and within this file, th...
[2 replies] Last: Hello justagreenie, Some FYI that might help. In line 5 if you are n... (by Handy Andy)
deleting variables from structure
 
Hi everyone, I need some help. I am trying to write a program in c that completely deletes all of the variables of this structure; struct user { char...
[9 replies] Last: Might as well add my two cents, despite the topic being checkmark'd. ... (by Ganado)
How do I eliminate the need for vectors?
 
I had some help coming up with this answer to a problem thus far, but it's not quite what I need. How would I rewrite this code without the use of arrays? Any a...
[13 replies] Last: no problem; was fun ;D. Use as much as you want. I should note, for ... (by icy1)
structures
 
I have the next code: new_->first = NULL; new_->last = NULL; new_->sum = 0; new_->len = 0; is there a faster way you can change the structure vari...
[2 replies] Last: thank you :) it works now (by yoli1780)
How to Initialize Integers + String Arrays
 
Hello, I'm new to C++ and need help! I'm currently learning how to do 2D arrays or just 1D arrays. I have a text file with the following contents shown below...
[7 replies] Last: @justagreenie , you still didn't properly explain the file format --> ... (by icy1)
declaring a vector
 
Write your question here. I'm using code::blocks and i am getting this error : ||=== Build: Debug in newbase (compiler: GNU GCC Compiler) ===| C:\mc\le_c\n...
[4 replies] Last: Thanks for further clarifying, and your patience. I have pretty printe... (by mycuser)
by b3y0nd
Using pointers for user defined array - calling array in function
 
First go through at using pointers to allow user defined array index. I can create the array - ptr1 and show the contents of the array. I am unable to "b...
[17 replies] Last: I cannot get the displayarray function to run "to run"? You cannot ... (by keskiverto)
Accessing values in an unordered_map
 
I have the following code that checks the value of each key in an unordered_map called char_count , and returns false if we find a value that is not equal to...
[1 reply] : for(auto i:char_count){ if(i.second != 0){ return false; ... (by ne555)
Help Begginer problem c++ segmentation "fail"
 
Hi, I try everything to fix this with pointers and etc... But I dont know if is me that doesn't know used them or not... Whatever, I keep getting this message i...
[3 replies] Last: Also, please don't use l as a variable name. It's too hard to tell the... (by dhayden)
segmentation fault on "End Of Fun" problem on SPOJ
 
I was solving End Of Fun on SPOJ. Everything is working fine for values of N smaller than 10,but for N > 10 it's giving segmentation fault.I wasted my whole day...
[16 replies] Last: Take #39 and #40 and for n>10 , testcases..it gives segmentation fault... (by amiable143)
JNI Help
 
So I am trying to wrap Flatbuffers with JNI so I can dynamically return the contents of a buffer as a JSON string using the FBS libs. I have the below code and ...
[8 replies] Last: helios - Thanks for the help. I initialized the pointer and all is wel... (by gboro54)
Member initialization list
 
Hi. I understand that when we have constant variables we have to use member initializers to initialize those constant variables. But my question is why should ...
[3 replies] Last: Initializing member variables the old fashioned way works most of the ... (by Manga)
by sinept
win32/c++ modeless dialog hides main window behind other apps on close
 
I have a modeless dialog (referred to as Toolbar) with a close control and two buttons that each open their own messagebox. If I open the toolbar, press a butto...
[5 replies] Last: @Thomas that's the tutorial I'm learning from (or an excerpt from it).... (by sinept)
assignment help: code gets thrown into infinite loop.
 
Im creating a dice game with 2 modes (play with 1 or 2 dice) with 2 human players. When i select 1 dice the program runs as it should, but when i select 2 dice ...
[1 reply] : if (roll1 || roll2 == 1) and else if (roll1 && roll2 == 1) are the... (by Too Explosive)
Partition of n into atmost k distinct partitions modulo m
 
Given N and K we have to find the number of partitions of N into at most K parts modulo m. I was wondering if there was any formula to calculate this type of qu...
[2 replies] Last: > I want to create a dp table to find the value your recurrence is p{... (by ne555)
Initializing a vector of vectors
 
I came across the following piece of code, and I'm struggling to figure out exactly what's going on: int n = 10; std::vector<std::vector<int> > adjacencyMatr...
[8 replies] Last: The cache for the most part takes advantage of locality of reference, ... (by helios)
July 2018 Pages: 12345... 17
  Archived months: [jun2018] [aug2018]

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