49,755 Topics

Member Avatar for
Member Avatar for madmaxx350

Hey guys :) i'm new at programming in C++ and i'm stuck at an assignment that im suppose to write I need to Write a string function that gets a word at random from a file and returns it as the value of the function. It should use a random …

Member Avatar for vmanes
0
70
Member Avatar for brechtjah

Hi, I'm having some frustrating issues with char/strings. I have a function which returns an unsigned short integer, the unsigned short integer is ALWAYS 1 char long. So if I try this code: [code] number[2] = function(); [/code] So, number[2] should give me the number I want, however, it gives …

Member Avatar for brechtjah
0
186
Member Avatar for glecymay

i hope you can help me regarding computing the running time of a program in C++ environment the specification is like this: i will make a program that can read another file which is a program too in C++. I would like to compute the main() alone of the file. …

Member Avatar for dmanw100
0
59
Member Avatar for Manutebecker

I want to be able to bring the single instance class into a function of another class without having to take each seperate little variable from the class and inject it in, can I just do something like void Yeah(class *The Class) and then pass the class in easily??? Or …

Member Avatar for Rashakil Fol
0
81
Member Avatar for 666kennedy

i have an array weights[16][60] 16 rows of 60 columns if you are changing indiviual elements it goes from weights[0][0] to weights[15][59] right? see if im using them in a loop for instance [CODE]]for(int i = 0; i < 16; i++) {[/CODE] so each element is used would it be …

Member Avatar for Rashakil Fol
0
83
Member Avatar for ishitasheth

Write a client-server application program to design a chatting room implementation using sockets to communicate between a server and clients. For this project, the followings are minimal requirements. Registration phase. 1.Each client will register to the server for joining a chatting with its own nick name. 2.One client will open …

Member Avatar for Rashakil Fol
0
115
Member Avatar for arreyes

If you make a vector of a class of no designated size, as you reserve spaces inside the vector will it just make a default instance from the constructor?

Member Avatar for ArkM
0
118
Member Avatar for 666kennedy

this is my sub proceedure [CODE]/****************************************************************************** * * Name: patpixselect * Parameters: none * Returns: patpix[] * Globals: none * Description: database for which pixels for which pattern *****************************************************************************/ int patpixselect (int pat); { float patpix[9] ; // array for pixels in patterns if (pat == 1) { patpix[0] = …

Member Avatar for VernonDozier
0
70
Member Avatar for k59smooth

I new to a C++, I downloaded the Microsoft Visual C++ compiler. I copy/pasted a simple program. [code=cplusplus] #include <iostream.h> #include <stdlib.h> int main() { cout << "This is my first C++ program." << endl << endl; system("PAUSE"); return EXIT_SUCCESS; } [/code] The compiler has an error that reads Cannot …

Member Avatar for Ancient Dragon
0
87
Member Avatar for kunlamp

[code=cplusplus] #include<iostream.h> #include<malloc.h> #include<stdlib.h> struct point{ float x; float y; point *next; }; point * create(int count) { point *p,*h,*s; h=(point *)malloc(sizeof(struct point)); if(h==NULL) { cout<<"Malloc memory error"<<endl; } /********************************************Init head**********************************/ h->x=NULL; h->y=NULL; h->next=NULL; /********************************************Init head**********************************/ p=h; for(int i=0;i<count;i++) { s=(point *)malloc(sizeof(struct point)); if(s==NULL) { cout<<"Malloc memory error"<<endl; } cout<<"cin …

Member Avatar for kunlamp
0
125
Member Avatar for elsa87

hi everyone the program below is a function that should give the number of items greater than a number entered by a user.(unsorted list ADT) ex: input 3 unsorted list contains: 2 6 8 1 5 9 8 output should be 5 here is my try by there are alot …

Member Avatar for WaltP
0
207
Member Avatar for freelancelote

Hi, the following code works fine, that is, strcpy effectively copies the whole string on temporal to word. [CODE=cpp] char word[20]; char temp[ ] = "hola"; cout << temporal << endl; strcpy(word, temporal); cout << word << endl; [/CODE] However, if I try to use the heap to store the …

Member Avatar for freelancelote
0
135
Member Avatar for 666kennedy

sorry if this a bit of a pain and there are other threads to read about this but can anyone explain how arrays work a bit, i need a quick refresher course. like how they work, are they like the equivalent of stacks in assembly language? and say you set …

Member Avatar for mrboolf
0
112
Member Avatar for tnvkrishna

OS: windows vista 32 bit. I was searching the web for a compiler which has lesser numbers of issues and with good written help available. I am thinking of vc++ or blood shed dev c++ Then I came across this term ANSI ..... Is it necessary for a compiler to …

Member Avatar for jbennet
0
214
Member Avatar for CantDoThis

well im doing a program that should output: A BB CCC DDD EEEE FFFFF using 2 loops. im on Dev-C++ 4.9.9.2 im all new 2 this an this is what i got so far, some help will b great to finish this =] [code=cplusplus] #include<iostream> #include<iomanip> using namespace std; int …

Member Avatar for mujash.techee
0
153
Member Avatar for brechtjah

Hello, I'm experiencing a little problem with what I'm trying to do: I've created a large number of buttons with Photoshop, these however, already look like buttons, and are rounded. However, when I put them on a BUTTON control the button looks ugly because it has another button on it. …

Member Avatar for William Hemsworth
0
127
Member Avatar for shankhs

I was trying to write a program that takes an input from a file which is located in Desktop not the default directory where the program is saved [code] #include <iostream> #include <fstream> #include <stdlib.h> using namespace std; int main() { ifstream fin; string str="C:\Documents and Settings\shankhs\Desktop\ccs\Assignment CCS.txt",temp=""; cout<<str<<endl; for(int …

Member Avatar for shankhs
0
139
Member Avatar for manzoor

Well see the above code [CODE] int a = 10; int* p1 = &a; int* p2 = p1; // Copies the address right?[/CODE] But what happens here? [CODE]char* str1 = "Hello"; char* str2 = str1; // What happens here[/CODE] I tried this code and when I modified str1, str2 remain …

Member Avatar for mujash.techee
0
128
Member Avatar for afg_91320

i cant seem to find what is wrong with this piece of code: looks good to me-but my hw says it has an error in the code. [code] struct TwoVals { int a = 5; int b = 10; }; int main() { TwoVals varray[1]; varray.a[0] =1; return0; } [/code]

Member Avatar for Narue
0
170
Member Avatar for Lokolo

[code] transactionInfo = date + " - " + _strtime( time ) + "New Customer - 1001 - Olly"; [/code] Ok so I've been trying to find it everywhere in C++ reference guides but it seems I can't do the above ^^ (says I cannot add 2 pointers). date is …

Member Avatar for Alex Edwards
0
187
Member Avatar for atish00

I have to make a project today itself on turbo c++ :- It should have OOP. Classes. and use of database i.e I/O on text files. Can anyone suggest a unique topic and I will be asking help related to the same here =)

Member Avatar for atish00
0
77
Member Avatar for Elmismo

Hi, I have these errors: --------------------Configuration: IP_devllink_06 - Win32 Debug-------------------- Linking... IP_devlink_06.obj : error LNK2001: unresolved external symbol _DLClose@4 IP_devlink_06.obj : error LNK2001: unresolved external symbol _DLOpen@24 Debug/IP_devllink_06.exe : fatal error LNK1120: 2 unresolved externals Error executing link.exe. IP_devllink_06.exe - 3 error(s), 0 warning(s) The probloem is that I am …

Member Avatar for ArkM
0
364
Member Avatar for spikeglow

can u pass template class objects as parameters to friend functions of the same class?? i tried sumthin like... [code=cplusplus] template<class T> class array { T a[10]; int n; public: friend istream& operator>>(istream&,array&); friend ostream& operator<<(ostream&,array&);}; istream& operator >>(istream& din,array& b) { din>>b.n ; //size of array for(inti=0;i<b.n;i++) din>>b.a[i]; return(din); …

Member Avatar for vijayan121
0
414
Member Avatar for omaranwar

Hi every one. This is my first Post. I am an electronic engineer and currently enrolled in MS Embedded Systems Engineering. In my project, i have to interface an Altera DE3 board to a windows based PC and achieve a data transfer rate of 100+ Mbps usin USB port. The …

Member Avatar for Nick Evan
0
221
Member Avatar for mibit

Could you please help me with the source code for the following Task: [IMG]http://www.2and2.net/files/492254f5267f5.png[/IMG]

Member Avatar for Nick Evan
0
105
Member Avatar for red10975

hi, I'm a beginner as far as c++ and i need help on writting a program. [B]Given[/B] sin x = x – (x^3/3!) + (x^5/5!) – (x^7/7!) + (x^9/9!) ….. where x is in radian. cos x = 1 – (x^2/2!) + (x^4/4!) – (x^6/6!) + (x^8/8!) ….. where x …

Member Avatar for vmanes
0
173
Member Avatar for NinjaLink

Hello. I'm having 2 difficulties... 1) I am trying to print out a string with spaces... Functions used: addSong and printSong For ex: (This is not the whole code...I'm pointing out the functions that it is used in) [CODE=Cplusplus] void addSong(mp3Type*& first, mp3Type*& last) { cout<<"Song title: "; cin>>songTitle; getline(cin,songTitle); …

Member Avatar for NinjaLink
0
211
Member Avatar for forgoodor4awsum

I am needing some help with my CS114 project. I am not expecting people here to do it for me just to help me with it. The project is to do a Sudoku game with a 2d array (9x9) and read in a txt file that the instructor has supplied. …

Member Avatar for VernonDozier
0
2K
Member Avatar for k59smooth
Member Avatar for davids2004

I do not want a negative number input for radius, length, width, base, height. How would I do this. My code is below. It should be pretty self explanatory. Thanks. [CODE][code=syntax] #include <iostream> #include <cmath> using namespace std; int main () { double const pi=3.14159; int radius, length, width, base, …

Member Avatar for davids2004
0
9K

The End.