Beginners - September 2020 (Page 3)

Rewrite while loop using for to read a txt file
 
If I want to use for() loop instead of a while()loop to read a file, do I count a total number of lines in an input file? If so, how to count it? Will it be sl...
[3 replies] Last: int n = (int)strlen(buffer) - 1; buffer = 0; The pr... (by dhayden)
C++ linker error? Won't compile in Xcode.
 
I had part of a polynomial multiplier program running in Xcode but after I added and deleted some code that wasn't working I got a build error. Undefined...
[9 replies] Last: Just one character after all: I forgot to remove an '&' that was in th... (by Dbreaker)
how to get backspace input from keyboard
 
hi to all, I've mysql server in centos6 server and codeblocks in centos 7client. i am trying to do autofill of product name when we input some initial lette...
[11 replies] Last: Well first you study how all the multi-byte key presses are encoded as... (by salem c)
How do you add 2D array elements diagonally?
 
In a C++ program I have a 2D array of integers. What kind of code would I need to sum each diagonal row of integers going from array = (0, 0) to array = (n...
[3 replies] Last: Hello Dbreaker, Another way to look at what salem c start with. I ... (by Handy Andy)
Calculator. How to fix if user types letters isto numbers (1,2)
 
Hi, Im trying to learn som C++ Im trying to make a calcylator. If the user types ex (nr1/n2) 2/b it crashes. How do I define nr1 nr2 to only digits? Oh, ...
[26 replies] Last: How to fix if user types letters into numbers See keyinp.hpp www.... (by seeplus)
Quick Sort - How to copy the remaining element back & rand the pv
 
First of all, thank you for everyone who took their time to help us, beginners, here to learn. My question for the day is I need to create a Quick Sort progr...
[4 replies] Last: say that you have arr = {"hello", "brave", "new", "world"}; suppose... (by ne555)
by ebz
How do I use VirtualAlloc on the Linux platform?
 
Hello! I somewhat learned how to use VirtualAlloc on Windows, but not sure how to do the same thing on Linux. I've got the following: memory = (unsigned ...
[4 replies] Last: Thanks :) (by ebz)
by Mif
Help with Keyboard input
 
When I press left, right, up, and down Keys always goes +2 if I change the keys for using direction to any other from the keyboard like e.g. w,a,s,d it's worki...
[11 replies] Last: Finally I solve the problem.. I had to reset the snake tail int the l... (by Mif)
Trouble with Arrays in Classes
 
I'm still somewhat new to C++, and I'm attempting to write an array from an users input inside an object. I keep getting the error "CRT detected that the applic...
[8 replies] Last: Thank you eveyone! Especially Dhadyden and seeplus because I now under... (by mygoodirishman)
Read data from file into array VS
 
Hello everyone, I am quite new learner of C++. In a data file whose extension is .dat named as Project.dat, there are two arrays that I need to read.They seem ...
[13 replies] Last: Hello everyone;Thank you to all of you. I understood well , I learnt h... (by learner999)
by ebz
Question about passing a struct to a function by reference. One of the properties reads -3689348814741910324
 
I'm trying to learn how to allocate memory reading a tutorial. I wanted to allocate 128mbs of memory. 64 for permanent memory and another 64 for allocating temp...
[2 replies] Last: Hey Ganado that worked perfectly, thanks a lot :) (by ebz)
by felloz
Pointers - question
 
I have the next doubt in the documentation https://www.cplusplus.com/doc/tutorial/pointers/ We can see this example in how to access a var address. myvar ...
[1 reply] : Yes. (by helios)
overloading ++ operators
 
Hi, I am learning about overloading the ++ operators, and I believe I have the concept understood. But there is a slight problem I am having. I dont understand ...
[3 replies] Last: post-increment is operator++(int), pre-increment is operator++(). De... (by seeplus)
by rin103
SIMULATION problem
 
I don't know what's wrong with my code. It runs, but it does not print properly. example simulation.txt ------ 2000 0.1 5 15 5 20 ------ #inc...
[5 replies] Last: That won't be what you got from your original code, where you were di... (by lastchance)
get rid of a statment without affecting the program
 
how can I rewrite the program so that the continue statement is no longer needed. // This program calculates the charges for DVD rentals. // Every third DV...
[6 replies] Last: break and continue are tools that you WILL need on occasion; that is w... (by jonnin)
help changing a simple statement
 
can someone help me to rewrite this code so that break; is no longer needed // This program raises the user's number to the powers of 0 through 10 #includ...
[3 replies] Last: Hello Leonardo797, Properly indented this is what your program looks ... (by Handy Andy)
help with int sum, average and total number
 
I just need help finding the count of the numbers that the user has entered, I don't need the sum or the total #include<iostream> using namespace std; in...
[2 replies] Last: Thanks jonin!!!, wow I forgot that (by Leonardo797)
BTW calculation
 
Hello World, im new in C++ programming. I would like to calculate the VAT rate of 6 items. I want to design a program that increases the price of an item wi...
[14 replies] Last: just one small note, but i think worth saying: you don't need to buy a... (by TLoke)
help with conditional statements
 
Hello I'm need some help with my condition statements for my "gear indicator" Arduino program for my manual car my H pattern manual gearbox has 4 sensors ...
[1 reply] : if you want it efficient, this begs a lookup table or a switch stateme... (by jonnin)
Is there a more efficient way?
 
I'm relatively new to c++(barely understand what I'm doing). but I tried to make a table. This however, needs some work. I basically made a user input and multi...
[3 replies] Last: reuse what you did already: xxy = 2*xy; etc... some compilers can chan... (by jonnin)
September 2020 Pages: 12345... 10
  Archived months: [aug2020] [oct2020]

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