49,761 Topics

Member Avatar for
Member Avatar for TJW

Why is the last element not 7 [Code] int array[3]; int *ary; ary=array; array[0]=0; array[1]=0; array[2]=0; array[3]=44; for (int i=0;i<4;i++) { cout<<array[i]; } cout<<endl; *(ary+0)=1; *(ary+1)=0; *(ary+2)=0; *(ary+3)=7; for (int i=0;i<4;i++) { cout<<array[i]; } cout<<endl; [/CODE] Output 00044 1003<-----------------Why 3 and not 7!!!!!!

Member Avatar for Dave Sinkula
0
189
Member Avatar for rochester

I was hoping that you could help me with some problems colleagues and I are having with a psychometric tool that we are developing for a short-term project. We were hoping to utilize Visual Basic C++ to get the job done. What we are essentially trying to do, but can't …

Member Avatar for iamthwee
0
141
Member Avatar for gerik

I've checked through the book list tagged on this forum, very helpful, but far too many books listed to efficiently check them all out. I already have one book on c++ (the teach yourself in 21 days), and it's nice, lots of short and to the point examples, but their …

Member Avatar for server_crash
0
117
Member Avatar for akshay_goel

I wud like u to suggest me some project in c++ or in computers for summer training for 1 month . I have just completed my 2nd year of b.teh

Member Avatar for happygeek
0
25
Member Avatar for conryf

I'm writing a program in VC++ 6.0 professional and am encoutering a baffling error. The program compiles fine, but seems to be fed up with anymore member functions. If I add one in the header implementation it still compiles but if I call that function anywhere in the program I …

Member Avatar for Dave Sinkula
0
119
Member Avatar for invinate

Hi, i've been reading about c++ advanced concepts such as polymorphism, (multiple) inheritance, templates, operator overloading and others. It all seems more or less clear to me but i know i would never really understand all these language features until i've used them. the problem is that i don't know …

Member Avatar for invinate
0
120
Member Avatar for dilip.mathews

Hi all, I created a string object and printed its size. Its always priniting output as 16. Why is it like that? Can anyone give me idea about how string class is implemented. I am using VC [COLOR=blue]string input; cin>>input; cout<<sizeof(input)<<input<<'\n';[/COLOR]

Member Avatar for Narue
0
119
Member Avatar for priya_2006g

[B]Hi Everybody, i am working on C++ and Oracle both but now i want to connect them,i want to retreive data fron SCOTT database of oracle using C++....i have no idea about it please help me....how to write a program,what steps to follow..[/B] [B]Priya[/B]

Member Avatar for priya_2006g
0
244
Member Avatar for Zilla32167

I am a student doing a research project at NIST, and as part of my project I have to run a series of simulations. My problem is this: I inherited the C code for the simulations from a previous student researcher who wrote it using Microsoft Visual C++ on a …

Member Avatar for Zilla32167
0
81
Member Avatar for paramveer

Hello group, Could anyone of you tell me how to convert string to const char* in C ....function c_str() is not working ...i dont know why............ Thanks...

Member Avatar for Narue
1
109
Member Avatar for Kumal

I can't seem to use the 'cin.get' statement for getting character arrays. I've just switched to VC++ Express, from Dev-Cpp, which allowed that. I have tried other methods like declaring the variable with 'string' but the compiler doesn't recognise it even with the <string> header. [code] void encrypt() { string …

Member Avatar for WolfPack
0
152
Member Avatar for deadprogrammer

Hi everyone I am really having trouble right now with oracle for linux. Please tell me how to connect oracle using c/c++ in linux. If anyone knows about any tutorial or have code, please plzzz post me that as well.

Member Avatar for WolfPack
0
163
Member Avatar for wani_raj
Member Avatar for rowin

Hi, is there a function to send a mail in C++ Builder? Kind Regards, Rowin

0
49
Member Avatar for rehmankhan

Please help me here. I am having problem in solving my home work problem in C++. I have attached my home work in a word doucment here. My home work is due on July 13th. I will be thankful. Thanks a lot.

Member Avatar for rehmankhan
0
108
Member Avatar for ostkaka

I have just started with a tutorial in c++ and i wonder if anyone can tell me what´s wrong with this code [code]#include <iostream> using namespace std; //so the program can see cout and end1 int main() { for (int x = 0; x < 10; x++) { cout<< x …

Member Avatar for dilip.mathews
0
76
Member Avatar for FireNet

K, It's fairly easy to use a ostringstream object or a derived class to output text like a normal stream class like cout. Eg. [code] class console: public ostringstream { public: void Render() { std::string buff = ostringstream::str(); //Some code to put it to screen //Write it to a file …

Member Avatar for FireNet
0
529
Member Avatar for dilip.mathews

Hi, I am bit confused with the concept of pointer to a data member of a class. In the below program what actually will the pointer variable be storing? When i tried printing the value of address I got value 1, Whatt does it mean? [COLOR=blue]class A{ public: int d; …

Member Avatar for dilip.mathews
0
168
Member Avatar for uxohus2b

Hi, Could someone tell me how I can delete files using a shell script or c++? The condition for deleting files: compare all files (say *.deb files) in folder A to those in folder B. If any file in B is also contained A, then delete the one in B. …

Member Avatar for uxohus2b
0
103
Member Avatar for ChimpusDupus

Hi, I've been wondering for a long time how one program can affect another program during run time by adding featues, retrieving information, submitting information and those sorts of things. One example of this might be a program like DeadAIM, which affects AOL Instant Messenger, or (doubtedly) if your in …

0
58
Member Avatar for zidane28

Help!!!!! I'm sorry to ask for help again but...... This question even difficult than the previous one..... Please write C++ code for the following algorithm: 1) Store first memory location of program into base register 2) Set program counter equal to address of first memory location 3) Load instruction of …

Member Avatar for WolfPack
0
145
Member Avatar for zidane28

Halo....I'm new here...... Can somebody help me with this question? Its a assignment but I REALLY DON HAV ANY IDEA HOW TO DO IT!!!! So....Plz help...... Write C++ code for the following algorithm: 1) Determine job's reqeusted memory size 2) if job_size>size_of_large_partition then reject job print appropriate message Go to …

Member Avatar for zidane28
0
109
Member Avatar for jatinder kumar

Hi,My name is Jatinder Kumar from India(Punjab).I have done B.Tech. in Electronics & Communications Engineering.Iam interested in software programming .I have also interested in hardware.

Member Avatar for Dani
0
44
Member Avatar for TuoPohc

I'm not going to post the code on this one just incase it's a little confusing. But here's the jist: I have a couple of nested loops with multiple (var)++'s inside as counters. Each counter resets itself after reaching 25 and the total of the counters much equal 120 in …

Member Avatar for TuoPohc
0
88
Member Avatar for winbatch

So here's what I'm trying to do. Basically, I have a huge text file of strings which are delimited by a delimiter. I would like to read each string separately based on the delimiter. Note that each chunk can span several lines, so I don't want to read it line …

Member Avatar for Ancient Dragon
1
217
Member Avatar for amethystglow

Given a set of data (two columns of data, flight path angles and lift coefficients) in a separate file, I need to write a program so the user can input a flight path angle and the program will return the appropriate lift coefficient given (if their angle matches one in …

Member Avatar for Salem
0
143
Member Avatar for kakeen

Yea, just recently I enrolled into a basic computer programming class. We use Turbo Visual C++ and umm so far it went okay until we talked about do-for-while loops... Can anyone help in making a program in loops >_< I mean I tried using the goto statements but my professor …

Member Avatar for WaltP
0
134
Member Avatar for slacke

I start to write a code for a shell with some basic functions: open files, save files, create files... I try to use the ifstream for opening files. I found the constructor - ifstream openfile("file.txt", ios::in); I try to use this constructor in the way (function openfile()) that I can …

Member Avatar for Dave Sinkula
0
98
Member Avatar for thlegendkiller

good day, I am an incoming 2nd year IT student and am encountering a problem in creating a "turtle graphics"(from the famous Logo Language) program using C. This case is found in the book of deitel and deithel, "C how to program" in the chapter of Arrays. it has almost …

Member Avatar for Dave Sinkula
0
1K
Member Avatar for dev.cplusplus

Hi, I'm looking for a function that will convert CString to char*, I found the function [code] char* ConvertToChar(const CString &s) { int nSize = s.GetLength(); char *pAnsiString = new char[nSize+1]; memset(pAnsiString,0,nSize+1); wcstombs(pAnsiString, s, nSize+1); return pAnsiString; } [/code] The problem is you cann see that there is the use …

Member Avatar for Ancient Dragon
0
168

The End.