Beginners - May 2009

I want to make random word, but got stuck
 
so here's the code randomize(); for(i=0;i<100;i++) { for(k=0;k<4;k++) { j = random(26)+65; name = (char) j; } } so I want to make 100 random wo...
[3 replies] Last: Wohooo I already made it, thanks for the comment... It's solved !!! (by clover88)
by GameOn
to chk if perfect square
 
i need to check if a number is a perfect square or not.its a big number so i take that number in long long or double but unfortunately both methods giving wro...
[1 reply] : you can do this by checking if the square root of that number is an in... (by Bazzy)
problem reading binary file
 
I use almost the same code to write to binary file but the problem comes when i try to read the file here i write to file which seem to work just fine no error...
[4 replies] Last: it probably is a knock off it is written by Stephen Prata i was goin... (by Livedereh)
by vmanx
Can't compile this..
 
Hi All, I am trying to compile this program, but am having some difficulty. Can someone please have a look at my code and tell me what I'm missing, or if any...
[3 replies] Last: cin >> numFloors has no semi-colon (by mcleano)
by hubbu
Trying to pass char* array in function, but stuck
 
Hi everyone. I'm trying to, currently, learn how to effectively use .h and .cpp files separately. I'm using a bubblesort program I wrote to get me started but I...
[3 replies] Last: If I remember correctly (I'm not in front of my Mac at the moment), in... (by Lodger)
by Null
char to char *
 
How can I convert char to char *? char c='a'; char *d=(char *)c; but it gives me a warning cast to pointer from integer of different size...
[1 reply] : The right syntax is &c but want do you want to do with that? http... (by Bazzy)
by jimctu
Resizing arrays
 
hi everyone... well i´ve got another little problem here... i have a structure like this: typedef struct parametros{ char* var; char* param...
[14 replies] Last: Condescending? condescending 1. Assuming a tone of superiority, o... (by helios)
Sorting algorithm
 
Im doing this program where you enter a movie collection and the it sorts it by the length of the movies. i get and error by at line 41 #include <iostream> #...
[3 replies] Last: You must be using a non-std compiler if this code compiles because you... (by kempofighter)
no matching function for call
 
Hey all, I have a problem with my code here, and i don't know how fix this. Here's the code: #include "Company.h" #include "Casual.h" #include "Manage...
[3 replies] Last: new Manager(ID, (Name1 + Name2), Numeric1) (by helios)
Hard time with Multiple definitions
 
My first time compiling as a project, and I am getting multiple definitions errors. I get 2 of them when I try to build the .exe file. I am using 3 files to bui...
[4 replies] Last: I see now. I should put just the generic class definition in the heade... (by budzbox)
dynamic allocation of multidimensional array
 
hi, why do i get the error this code or how do i allocate a multidimensional array with new? int main() { int *p; p = new int [ 3 ][ 3 ]; return...
[1 reply] : Read this article: http://www.cplusplus.com/forum/articles/7459/ (by Bazzy)
the problem of copy ctor
 
class A { int *p; public: A(int N){ p = new int ;} ~A() {delete p; p = NULL;} }; int main() { A a(5); A b = a; } It fails after...
[3 replies] Last: Are you allocating an array for the new object or did you just copy th... (by helios)
by Nedim
ASCII to hexadecimal
 
I am trying to make application like this: https://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=5679&lngWId=3 Here is my code: #incl...
[6 replies] Last: I was just playing with code :D I am still beginner Thank you again... (by Nedim)
generating array elements randomly with specific parameters
 
Greetings all! I know this is the first time I've posted here, however any help on the issue I'm having would be massively appreciated, I've been trying for ...
[4 replies] Last: Ah yea that's better, no infinite loop now. my output typically looks ... (by shoot to thrill)
overload <<
 
#ifndef FOO_H #define FOO_H #include <iostream> class Foo { friend std::ostream& operator<<( std::ostream&, const Foo& ); public: Foo::Foo(); ...
[2 replies] Last: Yes, but there is no point in providing default arguments for operator... (by Duthomhas)
by GameOn
confusion in code
 
i was stuck at 1 problem in which we need to implement bfs on topologiacally sorted graph(input graph was not sorted initially also this was prescribed {to sort...
[5 replies] Last: The URL requires login. i64 d(const vector<string>& v, int n, in... (by helios)
sorting array of strings
 
I am attempting to sort array of string with insertion sort alghoritam but i got run time error, problem is in variable i , in while loop when insted it in ...
[1 reply] : actually while(niz >temp && i>=0) { niz[i+1]=niz ; ... (by GameOn)
std::cout with vectors of objects
 
Hey all, #include "Company.h" #include "Casual.h" #include "Manager.h" #include "StaffMember.h" #include <vector> #include <string> #include <iostream> ...
[3 replies] Last: That much should segfault as-is. You don't need a pointer to your vect... (by Duthomhas)
Could you tell?
 
What is the format string for a long double?
[1 reply] : http://www.cplusplus.com/reference/clibrary/cstdio/printf/ Eh, OK... (by Duthomhas)
how can I fix this?
 
I wrote a program and when I try to compile it, these errors keep coming out and I don't know what to do. 1>c:\desktop\lab8\lab8\lab8.cpp(7) : error C2447: '...
[3 replies] Last: Line 5: {int main (); What is this meant to be? Did you mean int in... (by helios)
May 2009 Pages: 123... 21
  Archived months: [apr2009] [jun2009]

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