51,592 Topics

Member Avatar for
Member Avatar for meron seyoum

hi,i'm beginner for programming and i don't know how to use pointer in a c++ programming.

Member Avatar for rubberman
0
319
Member Avatar for Nathan_6

Hi everyone. I am makng a RISK game and I am working on a territory class here, and I got a strange message that my google searches have not shed any light on. My code is below. First, my header file: // Class represents each individual territory on the map …

Member Avatar for rubberman
0
535
Member Avatar for Nathan_6

Hi everyone. I am trying to develop a class for a RISK boardgame, and I used UNIT_COLOR and UNIT_TYPE enums to represent the different types of pieces. These enumerations are defined as public in my class but are causing complete havoc in my code because with the C++11 "class enum," …

Member Avatar for AssertNull
0
2K
Member Avatar for chrisschristou

hello friends. i have i simple c/c++ function that return the min of the array to the main function, in the body of the function i'm using an iterative loop so i would like to do it recursivly and i don't know from where to start! all reply are usefull …

Member Avatar for AssertNull
0
543
Member Avatar for Builder_1

//There is a problem in int main when scanning in the constructors into the pointer array ( found around line 843) //(sorts by the value generated in calcStockIndex — a method within the stock class) #include <iostream> #include <fstream> #include<cmath> using namespace std; /* Purpose: To store all information that …

Member Avatar for rubberman
-1
621
Member Avatar for can-mohan

Hi All, In below code when class a object is assigned to class b by returning object through factory method i observed assignment is not happening properly and after assignment still class b's object points to NULL object only. *cobj=rhs;//it gives NULL object However below statement works perfectly when b …

Member Avatar for can-mohan
0
318
Member Avatar for rose_2

I tried to draw that shape but it doesnt work in right way .. any help? example for size = 3 print: * * *** * * #include<iostream> #include<cmath> using namespace std; int main() { int N, t,col,row; cin >> t; for (int i =0; i < t; i++) { …

Member Avatar for rubberman
0
100
Member Avatar for amanueal
Member Avatar for can-mohan

Hi All, After compiling below code , I am getting below error. error: cannot convert a* to b* in assignment. it seems to be assignment doesn't work with pointers . Can anybody throw some light on this? i tried to use unique_ptr by transfering the ownership from a to b …

Member Avatar for can-mohan
0
350
Member Avatar for Sarankulu

We follow debugging with writing debug logs in the file to find any bugs in vc++ and visual studio. Is there any other better way doing the same. Thanking in advance

Member Avatar for tinstaafl
0
61
Member Avatar for Gribouillis

This snippets contains a python program to find a shortest solution to the problem of the farmer who whishes to cross a river. The boat can only contain two things, including the rower. The farmer comes with a wolf, a duck and a bag of corn, and he can't leave …

Member Avatar for Gribouillis
0
2K
Member Avatar for Builder_1

A farmer with his wolf, duck and bag of corn come to the east side of a river they wish to cross. There is a boat at the river’s edge, but of course only the farmer can row. The boat can only hold two things (including the rower) at any …

Member Avatar for AssertNull
-2
2K
Member Avatar for NEwB!e

void Selection_Sort(int SUM_1[], int n){ int Lid, tmp; for (int i = 0; i < n - 1; i++){ Lid = i; for (int j = i + 1; j < n; j++){ if (SUM_1[j] != 0 && SUM_1[Lid] != 0 && SUM_1[j] < SUM_1[Lid]){ Lid = j; } tmp …

Member Avatar for tinstaafl
0
162
Member Avatar for doug65536

I have a project that uses DirectSound to play streaming sound. I use SetThreadpoolWait to get a threadpool callback every time the notification (AutoReset) events are signalled. (To fill the streaming buffer with more audio). The new Win7 threadpool API requires you to use SetThreadpoolWait to schedule a new wait …

Member Avatar for Klaus_1
0
562
Member Avatar for Nathan_6

Hi, everyone! I have to make a function which would get a c-string of an inputted text and it would output the number of times each unique word occurs in it. Of course, I must use c-strings [yeah yeah, I know but that is what the assignment is]. Here's my …

Member Avatar for Nathan_6
0
402
Member Avatar for can-mohan

Hi All, Below is the code of implementation of aggregation in c++. In this code class bar object will be contained in class a but class a won't act as a owner of class bar and due to this bar object is deleted after class a's life time ends. Now …

Member Avatar for StuXYZ
0
217
Member Avatar for NEwB!e

Help me please! below is a part of the code which causes the error. int B[996]; for (j = 0, k = 0; j < (N / 6); j++){ if (A[j] == 0){ continue; } B[k++] = A[j]; } //팀원이 여섯명인 팀만의 순위대로 저장한 배열을 새로 만듭니다. int SUM[167] = …

Member Avatar for AssertNull
0
225
Member Avatar for can-mohan

Hi All, In below code i am surprised to see destructor for rectangle class is not being called though base class destructor for IShape is virtual. below is the output of below programme: draw the rectangle draw the circle draw destructor deleting circle **deleting the Rectangle** is missing from output …

Member Avatar for can-mohan
0
271
Member Avatar for mpdph09

I have windows form with usercontrol to display image. I am trying to reset the autoscroll position to the top of the image if the user had scrolled down to see bottom part of the image. So at index change it should display top part of the next image that …

0
137
Member Avatar for zeinc

How to write a C++ program doing the following : a series of names with no blank characters and displays the number of the names having more than ten charaters. the name must not exceed 25 characters and the series ends when the user enters the word "end".

Member Avatar for AssertNull
0
216
Member Avatar for Nathan_6

Hi everyone. I was reading some source code and I cam across the line `cout << "\nu converted to upper case is " << static_cast<char> ( toupper('u') ) << endl;` Why would the programmer use static_cast<char> in conjunction with toupper to print 'U' instead of just typing `cout << "\nu …

Member Avatar for Nathan_6
0
570
Member Avatar for Usman_9

#include<iostream> #include<stack> using namespace std; struct node #include<iostream> #include<stack> using namespace std; struct node { int data; node *left; node *right; }; class usman { private: node *root,*leaf; int count; public: usman(); //~usman(); bool input(); void call(); void preorder(); void postorder(); }; usman::usman() { root=leaf=NULL; count=0; } bool usman::input() { …

Member Avatar for rubberman
0
202
Member Avatar for Usman_9

hy ,i make binary tree,the input of binary tree in correct.but issues traversing of binary tree using stack ,because the result of traversing is wrong .please solve this issues. #include<iostream> #include<stack> using namespace std; struct node { int data; node *left; node *right; }; class usman { private: node *root,*leaf; …

Member Avatar for rubberman
0
195
Member Avatar for DS9596

Can someone check if I got these correct please?? I'm pretty sure I missed almost half of these so I really need help on these. If someone can explain how to get an answer, that would be great. a: 5 b: address of location of x (0x....) c: address of …

Member Avatar for jacks009
0
311
Member Avatar for sya20

It has been a long time since i do C++ programming and I am stuck on this question. I don't remember how to solve this kind of question. haha Part 1: Develop a C++ program which asks the user for the choice of either 3x3 or 4x4 2-dimensional array (use …

Member Avatar for pass4sureguide
0
417
Member Avatar for AKRAM83

I need to write a program to create palindrome words by using the string entered by users. The program should have 2 strings: the first string is used to store input text from the user and the second string is to store the same input text from the user in …

Member Avatar for rubberman
0
301
Member Avatar for simmyk

I need to read from a txt file and then pass that array into another function which prints the data in a neat organised manner depending which type pf book it is... So if its audiobook then the book is listed under audiobook, if ebook then under ebook etc... I …

Member Avatar for rubberman
0
430
Member Avatar for rose_2

I make a program to simulate the Shortest Job First algorithm in CPU scheduling .. this function will calculate the start , end, turn,and wait time for each proccess according to Non-preemptive way .. the 1st condition gonna check for the 1st arrival time or the smallest burst time .. …

Member Avatar for rose_2
0
424
Member Avatar for bosnian.magic

Hello I've problem with reading a text file and using it in textbox and combobox combination. I've got text file ( which I open easly ) where the data is presented like this: > English cat dog cow > French chat chien vache What I want to do is to …

Member Avatar for tinstaafl
0
231
Member Avatar for Werwerwerw

How do I modify minhook in order to be able to hook undocumented functions? I'm a beginner and this is beyond me.

Member Avatar for rproffitt
0
363
Member Avatar for Werwerwerw

Hi, I have a hooked function, NtTerminateProcess. I am trying to get the full path to the process handle passed to TerminateProcess. The injected app is taskmgr and GetProcessImageFileName is returning ERROR_ACCESS_DENIED. I even tried opening another handle to the process to ensure I have the required access rights, like …

Member Avatar for Werwerwerw
0
450
Member Avatar for can-mohan

Hi All, In below design i would like to know the appraoch of deletion of base class pointer .It is pritty clear that deletion of base class object obj won't take place inside Draw destructor. Apart from this same code i have tested using unique_ptr and as expected it is …

Member Avatar for rubberman
0
252
Member Avatar for can-mohan

Hi All, In below code i am performing search in map through key value but not able to get the desire results though common elements (intersection) is present in both lists. #include <iostream> #include <stdio.h> #include <stdlib.h> #include <map> using namespace std; struct node { int data; struct node* next; …

Member Avatar for jayashreemarg
0
217
Member Avatar for rose_2

I tried here in this code to insert struct information then assign to vector and get the smallest age .. i want to do that with vector to learn more about it .. can anyone help me to fix it .. and explain to me what's wrong in my thought …

Member Avatar for rose_2
0
167
Member Avatar for Moeen_2

I am new to c++ and puzzle about parameters and argument definitions,Please help me i will great thankful to Dani web members.

Member Avatar for Moeen_2
0
92
Member Avatar for Gà_1

Hi every one, I had implemented Karatsuba algorithm in C++, but I have been stuck for 2 days. First problem is the function give incorrect answer, second problem is it oftens crash when run (runtime error). I try to debug but cannot understand how it's not work. I hope someone …

0
234
Member Avatar for manaila

I have been struggling with this for two days now, with no luck. I have a **C** `char` array `char myArray[] = "Hello World";` I also have a pointer to pointer to *char* `char **ptr;` So I want to somehow store `myArray` to `ptr` or somehow convert `myArray`into pointer to …

Member Avatar for jacks009
0
316
Member Avatar for crazyninja247

Test Scores #2 Modify the program of Programming Challenge 2 to allow the user to enter name-score pairs using two parralell arrays. For each student taking a test, the user types the student’s name followed by the student’s integer test score. Modify the sorting function so it takes an array …

Member Avatar for rproffitt
-1
2K
Member Avatar for directorabbey

void Halt (); void Reply (const char * num,uint8_t stat); { this is the error message for this code 7|error: 'uint8_t' has not been declared 9|error: expected unqualified-id before '{' token

Member Avatar for directorabbey
0
275
Member Avatar for Muhammad_111

anybody tell me please what is wrong in this code it will give me only blank console screen? #include <iostream> using namespace std; int main() { int x=1; int y=2; int z; while(x<=50) { while(y<x) { z=x%y; if(z==0) { cout<<x<<"is a prime number"<<endl; } else { y++; } } x++; …

Member Avatar for TheFearful
0
200
Member Avatar for crazyninja247
Member Avatar for crazyninja247

using 'strcpy_s' error c2660 void sortData(int size, char studentName[][6]) { bool swap; int temp[6]; do { swap = false; for (int count = 0; count < (size - 1); count++) { if (strcmp(studentName[count], studentName[count + 1]) > 0) { strcpy_s(temp, studentName[count]); strcpy_s(studentName[count], studentName[count + 1]); strcpy_s(studentName[count + 1], temp); swap …

Member Avatar for AssertNull
-1
76
Member Avatar for steve.dannay

Hello Please tell me how can I used CLS in C++.. In any programm. ?

Member Avatar for underjack
0
148
Member Avatar for rob2

Hi fellas I'm reading "Teach yourself C++" book by Herbert Schildt to learn C++. there is an example in chapter 10 which is tough to me. this is the code I'm talking about: #include <iostream> #include <cstdlib> #include <cctype> using namespace std; class list { public: list *head; // pointer …

Member Avatar for Gribouillis
0
233
Member Avatar for can-mohan

Hi All , In below code i am getting error while assigning one object with other and result is clear as both objects are different types. it is expected that RHS object should belong to same class. How to resolve this issue. error: no match for operator= in obj1 = …

Member Avatar for can-mohan
0
320
Member Avatar for Kenny_1

so the program needs to dynamically allocate an array large enough to hold a user=defined number of test scores. once all scores are entered, the array should be passed to a function that sorts them in ascending order. another function should be called that calculates the average score. the program …

Member Avatar for Kenny_1
0
1K
Member Avatar for Lucas_9

Please help me , I need to convert this C code in Python: #include<stdio.h> #include<stdlib.h> #include<conio.h> main() { system ("color F9"); float preco[150], precoNF, NFPreco_Produto[150]; //Vetores e variáveis que trabalham com preço int a=0, x=0, v=0, rel=0, y, i, aux, cod_exclui, troca; //Declaração de variáveis utilizadas para leitura, gravação, exlclusão …

Member Avatar for Gribouillis
0
1K
Member Avatar for mabdullah4

I want from program that it force the user to input valid value.When ever user enter caharcter in integer valriable it force the user to input the right value.But this does not work.If user input invalid value it start looping. #include <iostream> using namespace std; int main() { int x; …

Member Avatar for AssertNull
0
3K
Member Avatar for mabdullah4

Why This Program is not Changing Directory from C:/ to H: Drive or D: Drive. #include<iostream> using namespace std; int main(int a,char *b[]) { int option; cout<<endl<<"Enter 2 for 2nd Semster Programs "<<endl; cout<<endl<<"Enter 3 for 3rd Semster Programs "<<endl; cin>>option; if(option==2) { system("D:"); system("explorer ."); } else if(option==3) { …

Member Avatar for AssertNull
0
360
Member Avatar for Quezia

The End.