210 Topics

Member Avatar for
Member Avatar for borchu

Hi, my question is simply but a little bit tricky; let assume that there are two array array1 = (2, 5, 6, 1, 7) and array2 (3, 2, 6, 8) and after function setUnion new array or use pointer return (2, 5, 6, 1, 7, 3, 8). Below my code …

Member Avatar for mazzica1
0
560
Member Avatar for TheNNS

This is a somewhat big project for me as I'm not very experienced in c++. The end goal is to read a text file, and read every word in the text file. Each time a new word is read, store it in a vector. If a word is repeated, keep …

Member Avatar for TheNNS
0
3K
Member Avatar for jaykool74

Using NetBeans IDE 7.0.1 with Java SDK 1.7.1 and Glassfish 3.x: I am trying to load an ArrayList from a database in the Servlet to be used on the JSP page in a dropdown box that would show stock symbol and company name. I get the following message when trying …

Member Avatar for jaykool74
0
5K
Member Avatar for niyasc

Following is the code written to implement a employ manipulation system using pointer to structures . It makes some allocation problem in dev-cpp while work well in turbo c. Can you help me to understand the problem[CODE] // Implement pointers to structures to produce employ manipulation and produce output //as …

Member Avatar for Narue
0
183
Member Avatar for bowmaster

i have the folowing code in my jsp page: [CODE]String[] name = null; String[] manufacturer = null; String[] description = null; String[] category = null; String[] price = null; String result = null; String connectionURL = "jdbc:mysql://localhost:3306/syte"; Connection connection = null; Class.forName("com.mysql.jdbc.Driver").newInstance(); connection = DriverManager.getConnection(connectionURL,"root",""); Statement statement = null; statement …

Member Avatar for bowmaster
0
188
Member Avatar for falconmick

I promice everone that I have looked and looked and looked for a solution, I'm not just having a problem and being lazy putting it on daniweb... haha :) ull have to trust me, ive even googled it :O! Ok, so I am wondering, if I wanted to return a …

Member Avatar for falconmick
0
237
Member Avatar for hackit

i want to learn the complete working of pointer in c. i tried it many times but it is very difficult so please help me.

Member Avatar for cse.avinash
0
160
Member Avatar for IMJS

I am trying to utilise a development kit for software that we use at work. I think I have found a member function that would address a problem I have and I'm trying to test it. The documentation says that it is used thus: [CODE] int SDKclass::SDKclassmethod( a_data_type** a_data_array_ptr, char*** …

Member Avatar for fruitymo
0
112
Member Avatar for manish250

hello all i have been writing the java code and new to C programing.I am very confused in point.i have the following code [CODE]#include<stdio.h> main() { int *ptr=50; printf("%d",*ptr); return 0; } ~ ~ [/CODE] why it is giving the segmentation fault.and when i print ptr then it gives value …

Member Avatar for bajishareef
0
139
Member Avatar for trantran

I have a C++ standard related question. Let's say I have 2 derived object D1 and D2 (which may contain class D virtual functions) of an identical class base B. Now, I create base pointers bpD1 and bpD2 to those objects. 1) Are bpD1 and bpD2 *guaranteed* to be different …

Member Avatar for trantran
0
184
Member Avatar for Nicco

Hi there, I'm working on a map for a class assignment and running into trouble. I've tried looking around the web but couldn't find anything that helped. I know how insertion works on a basic level when returning a node pointer but think i'm missing some key ideas when using …

Member Avatar for Nicco
0
2K
Member Avatar for Muhammad Anas

I just found a question whose statement is as follows: [COLOR="Green"]Write a function contains(const char*, char) which returns the pointer to the first (left-most) occurrence of the 2nd parameter char in the 1st parameter cstring, or NULL if the cstring doesn't contain the char. [/COLOR] Another condition is that inside …

Member Avatar for Muhammad Anas
0
262
Member Avatar for IMJS

Hello, please can I have some clarification to check I am not doing something very stupid? It seems sensible with all that I have read, but I'm not confident. I suspect I have memory leaks and want to make sure some fundamentals are correct before I start looking deeper. My …

Member Avatar for mrnutty
0
172
Member Avatar for Red Dragon

the aim of this programme is to create a .txt file (of which the name is specified by the user) of all the items in a certain directory (also specified by the user) the problem is about half way down, the 'mydir' bit [CODE] #include <iostream> #include <fstream> #include <string> …

Member Avatar for Red Dragon
0
356
Member Avatar for n1csaf3

I am having trouble correctly allocating memory for a parent function that will remain upon the child functions exit. the call to the child function is [code=c]HTTP_packToGen((char*)http_headerContent.HTTP ..[/code] the HTTP variable within http_headerContent is a char pointer that isn't allocated until the child function is called, http_headerContent is a static …

Member Avatar for n1csaf3
0
318
Member Avatar for cousinoer5

This program keeps track of a hardware store inventory. It's very barebones, all it needs to do is put the information into a vector of pointers to a struct, allow the user to sell items, and print the report. I have printing down no problem, but selling is where I …

Member Avatar for Chilton
0
174
Member Avatar for ispeakbinary

I am trying to create a class for doing number factorization on a random number, so I need to create a pointer to store the factors of the number. But when I compiled it, I got an error. My question is 1)What did I do wrong? I have a feeling …

Member Avatar for csurfer
0
156
Member Avatar for YodaMerlin

I have a pointer object consisting of different arrays of variable length. I want to get one of the arrays from the pointer array and store is in a different array. How would I go about doing it? When I try the method, it gives an error: [B]initialization with '{...}' …

Member Avatar for YodaMerlin
0
229
Member Avatar for YodaMerlin

I have a variable [B]x[/B] declared as [B]int *x = y[/B], where [B]y[/B] is also a pointer variable. Is there any way to store the variable in [B]y[/B] to [B]x[/B] without making [B]x[/B] a pointer such that it would look like: [CODE] int x = y; //y declaration => int …

Member Avatar for YodaMerlin
0
158
Member Avatar for bfprii

I do not understand why the pointer addition is failing. [CODE] char *pipebuf=new char[40001]; CommandRobot *cr= (CommandRobot*)pipebuf; cr->command=2; DWORD *rooms=(DWORD*)(cr+1); *rooms=100;[/CODE] For some reason after executing the value of pipebuf only contains the value of command, it does not contain the value of 100; Yet, when I remove the new …

Member Avatar for Narue
0
145
Member Avatar for Forthright

Hi I am trying to call a 3rd party method which relies on const char* I want to pass an arbitrary value. The (broken) code below should show what I'm trying to do. [CODE] #include <iostream> #define MAX 1000 // 3rd party stuff void ConstPtrMethod(const char* s) { std::cout << …

Member Avatar for Forthright
0
339
Member Avatar for iamthesgt

This is homework. I am not asking for someone to write this code for me, just to help me understand how to solve my problem. I have to take two lists or integers inputted by the user, sorted in ascending order and combine them using pass-by-reference to return a pointer …

Member Avatar for iamthesgt
0
274
Member Avatar for vidit_X

I'm a lot confused with multi-dimensional arrays and pointers. I tried searching, found and read some articles. But there are still some doubts. We can not use a double pointer(int **) for a two dimensional array, right? Instead we need to have an array of pointers with the length equal …

Member Avatar for vidit_X
0
174
Member Avatar for barevhayerable

hello everyone.. please answer me , if you can give me working code I thought about something... I know that everything in our machines have addresses.. I thought about watching everything in my computer's random access memory(RAM) But I don't want to see the information in view of garbage , …

Member Avatar for Ancient Dragon
0
193
Member Avatar for Chris11246

I haven't written any code in a while and I'm trying to refamiliarize myself but I am having trouble. Im trying to make it so that all the values in an array move down one. Im trying to do that by adding 1 to the value of the pointer that …

Member Avatar for Ancient Dragon
0
95
Member Avatar for Majabat

Dear All, I’m implementing a vector class that allows me to do vector arithmetic. What I’ve implemented is the following: [CODE]class mVec { private: float vec[3]; public: mVec(); mVec(const float * const parray); mVec(const float a, const float b, const float c); ~mVec(); mVec operator+(const mVec& param); mVec operator-(const mVec& …

Member Avatar for Majabat
0
155
Member Avatar for mistymarian

Hi. . . i got this code in visual c3 and i want to code it in visual basic. . .somebody help me please in doing it. . . [code] byte* p = (byte*)(void*)Scan0; int nOffset = stride - b.Width * 3; for (int y = 0; y < b.Height; …

0
87
Member Avatar for vineeshvs

[CODE] #include<stdio.h> #include<stdlib.h> int **array(); main() { int **result=array(),i,j; //display result for(i=0;i<2;i++) printf("\n"); for(j=0;j<2;j++) printf("%d \t",result[i][j]); } //function int **array() { int nrows=2,ncolumns=2,i,j; // printf("hi"); //memory allocation int **array; array = malloc(nrows * sizeof(int *)); if(array == NULL) { printf("out of memory\n"); return 0; } //printf("hi"); for(i = 0; i …

Member Avatar for vineeshvs
0
244
Member Avatar for tanzi816

I'm trying to write a program that can win a Battleship game in fewer than 60 guesses. Since the Battleship game that I am writing this for uses a 10x10 array, I thought that first of all I would just try to win the game in 100 guesses before I …

Member Avatar for vinitmittal2008
0
232
Member Avatar for iamthesgt

Hello, I need to take a file filled with numbers and input them into a two-dimensional array. The file would look like: 3 6 3.9 4.5 2.1 1.0 2.4 4.3 3.1 4.2 5.1 6.2 1.0 2.7 1.2 2.3 3.1 4.2 5.2 6.4 where the first two numbers are the vertical …

Member Avatar for iamthesgt
0
166

The End.