Beginners - September 2021 (Page 2)

by Rongo
iterating through a linked list
 
I am creating a spell checker that uses a dictionary in a linked list. I also have a book fin another that I am reading word by word. I want to create a loo...
[2 replies] Last: Read the words in the dictionary file into a list (std::list), if you ... (by JLBorges)
c++ beginner - input name using struct
 
This is the description of the practise im doing. Write a program that reads peoples’ names and ages into an array of type struct. The names should be sto...
[4 replies] Last: ah, its a political survey! (by jonnin)
for triangle
 
I want to put the square in between the triangles to create a star, I don't know where to put my code of the square. Thank you! output: * *** ***...
[1 reply] : These kinds of homework work best when you get yourself some graph pap... (by Duthomhas)
Error when iterating through template function with char
 
The for loop I'm using in the header file of a school project doesn't seem to be working. There seems to be an issue with using a char variable but I don't unde...
[1 reply] : Show the code that called it. Your error message is clear as it stand... (by lastchance)
swap c++/ reference
 
Is really necessary to use reference variable when create function to swap elements like below! void swap(int & Num1, int & NUm2) { int temp = N...
[6 replies] Last: a pointer is a lot like a reference, but a pointer is NOT a reference.... (by jonnin)
How to store something in a string without user input?
 
Hi! I am working on another project, and got stuck...again. This time, my problem is that I want to store something in a string without user input. I have marke...
[6 replies] Last: Thank you so much guys, this was super helpful. (by BeginnerCoder123)
Sentinel Value and If statements
 
Hello! I am a beginner coder and I am stuck on sentinel values. The problem is that I cannot get the code to move on to the else part of the if statement when t...
[3 replies] Last: Thank you so much guys, this was very helpful! (by BeginnerCoder123)
by nvadam
If within for loop, 'if' not activating
 
I have an input of one integer from 1 up to 100(lets call this N). Then another N number of boolean inputs (lets call this J). J is an array with the size of N ...
[3 replies] Last: yepp seems like it was nothing to do with this loop.. thanks i worked ... (by nvadam)
hi all I am a beginner to C++ and I need some advice for my programme
 
#include <iostream> #include<string> using namespace std; int main(int argc, char** argv) { do { char choice; cout<<"M...
[6 replies] Last: It would be more usual for Quit to be an option on the menu - rather t... (by seeplus)
HTTP GET winsock
 
Small HTTP client console app trying to understand GET requests. It always connects every single time I get a reply HTTP/1.1 200 OK Date: Fri, 24 Sep 2021 17:2...
[8 replies] Last: > thanks, I just didn't understand that recv() could return data in pi... (by salem c)
Begginer need help at homework
 
Hello, this week we just started at school learning basic c++ operations, the theacher is an older man with no sense for people so he has a hard time teaching u...
[2 replies] Last: but is it that you don't know how to code the c++ stuff - or don't und... (by seeplus)
BMR Calculator for chocolates
 
I'm somewhat new to programming and have been assigned to see how many chocolate bars it would take to eat in order to gain a pound. Assuming that the chocolate...
[2 replies] Last: A bit of helpful advice.... PLEASE learn to use code tags, they make... (by George P)
Visual Studio: Opening Windows
 
OK. Weird question. I want to make a program in C++ that can open a exe that the user probably already has (such as google), using a specific directory such as...
[15 replies] Last: oops copied the wrong directory haha (by Grust697)
Populating a linked list
 
Hi, Basic question. I'm trying to rekindle my C++ skills and I'm working through online problems. I came across one on linked lists and realised I don't rememb...
[3 replies] Last: Thanks, I'll give those a try. (by Thunderchook)
int *y = malloc(100);
 
Can someone explain line Nr (9) and what is malloc function? #include <stdio.h> #include <stdlib.h> int main(void) { int x = 3; int *y = malloc(100...
[5 replies] Last: if you care, this is C code. C++ usually uses new instead of malloc. ... (by jonnin)
namespace issue with scope
 
Hello, I am a beginner at writing c++. In the code below, I am trying to include this namespace but when I compile just the below code, I get an error tellin...
[6 replies] Last: @seeplus ahh, I see, I will add that to the code instead of the int th... (by SemogEnaz)
Inverting modulas???
 
In equaltion, x%3=2 how can i calculate x??
[6 replies] Last: I think its a "remainder operator" not a "modulo operator". Restrict t... (by lastchance)
memory-user.c
 
Can someone write comments on this code to be more understandable #include <stdio.h> #include <stdlib.h> #define NITER 10000 int main(int argc, char *arg...
[4 replies] Last: It can do something that surprises us; the program may engender undefi... (by JLBorges)
by Milnk
How to write this as a forloop program?
 
It goes like this, If the input is 5 it should output this. 1.2.3.4.5 2.4.6.8 3.6.9 4.8 5 Any idea how to do it? TYIA. Edited: I have solved it myself ...
[5 replies] Last: ah, the single loop was not so bad with the extra variable. I was thi... (by jonnin)
by jhw
Attempting multithreading in Windows under MingGW64
 
Hi ya'll I'm' attempting to run a multithreaded process by using std::for_each(std::execution::par_unseq, ... the program works correctly but when I ...
[3 replies] Last: It could be just the implementation, and nothing to do with your envir... (by kbw)
September 2021 Pages: 1234... 7
  Archived months: [aug2021] [oct2021]

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