function pow..

435 byte By Rooting at 2007-11-20 11:41:39
searching on internet i see that the function pow of maths.h don't exist whith a tipe int..so int pow() doens't exist..if in openbsd i make a simple program, whith a pow funciton like thisint a= 2;int b= 3;cout << pow(a, b);return an error..but in visual cpp don't return it..why...

functions

424 byte By staticVoid at 2007-11-20 11:41:40
I'm fairly new to c++ and was wondering...LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);I assume LRESULT is a typedef and WindowProcedure is the name of the function but what is CALLBACK. I thought the stucture of a function was data_type function_name(parameters). Ive been thre...

Sub-Functions in C

1177 byte By cuba06 at 2007-11-20 11:41:44
I've been instructed to create a program that will print a table of efficiencies of a four-stroke engine for different values of compression ratios depending on the specific heat that the user enters.The only thing is that we've been told that we need to use sub-functions to do different t...

[C] A hard-to-implement Algorithm

1072 byte By mfonz85 at 2007-11-20 11:41:53
Hi all, a friend of mine recently explained to me a problem he hasn't solved yet, I'll try to explain it briefly so you can think a minute or two about it...It has to be resolved with a standard C command line program, the old fashion way...(1) We have a 16 elements array.(2) We have a num...

Need help.

995 byte By k0b381 at 2007-11-20 11:42:06
Have the user enter a character. Tell them if the character is a number, a lower case letter, an upper case letter or neither a letter nor a number. i cannot figure out how to make it so the program knows its neither a letter nor a number , this is my code so far#include <iostream.h>int main()...

C++ String manipulation, input file.

2642 byte By JoBlo69 at 2007-11-20 11:42:13
Hello,I am in the middle of writing a C++ app in which the user has to input a file path, and the app "echo's" the contents of the .txt file into the cmd window...This is the layout of the .txt file.Fresno Ca 2.69Oakland Ca 2.69Corvallis Or 2.89Vancouver Wa...

filesystem

1040 byte By staticVoid at 2007-11-20 11:42:25
having a problem with checking to see if a directory exists:#include <iostream>#include <dirent.h>#include <sys/stat.h>using namespace std;bool isdir(const char * filename) { struct stat *buffer; stat(filename, buffer); if(S_ISDIR(buffer->st_mode) == 1) { return true;...

Skipping non-integer values

501 byte By frasifrasi at 2007-11-20 11:42:41
Say I have a list of numbers and that my program is only supposed to deal with integer values... Does anyone know a simple way to determine if one of the values is a decimal (like 5.6) , output a message and skip it?I already know a way to locate letter and output an error message, but the if statem...

help with bi-directional association

1267 byte By idwilson at 2007-11-20 11:42:49
Hi,I have some Java code that I am trying to convert to C++, but I am stuck.I have a class called Person that has an association with a class called Address, and the Address is associated with a Person.So, the skeleton I have looks like:class Person{friend class Address;private: string name; Address...

About This program

246 byte By dragoon112 at 2007-11-20 11:42:56
Hello, i bought a program from a guy that i know. i bought program and source. it is a zlib .RFP and .RFI unpacker. it unpacks to a folder. but i wanted to know if someone can reverse the script to make the folder pack into an RFI and RFP. Thanks

Question on CIN

679 byte By Flakester at 2007-11-20 11:42:58
Hey guess, sorry for the rookie questions. I'm new to this, I tried a search and really dont even know what I'm looking for, or what this would be called.I'm trying to make a numerology report, but I'm not looking for complete help.I just have a simple question reguarding my cin...

partially AI program

894 byte By nerdykid at 2007-11-20 11:43:06
im trying to make a program that has an awkward for of artificial intelligence. its actually quite a pointless program, but it will help me introduce myself to another aspect of programming. in this program, the user enters any input, such as a command, and it iterates through a file. while iteratin...

Borland C++ 5 to 6 template code migration

614 byte By Kotfeller at 2007-11-20 11:43:14
Hi,I developped a code of mine in Borland C++ 5, as I tried to compile it in Borland C++ 6, a strange error code appear:The code is based on template:template <class Foo>class TExample : public Foo::arg{};During the first compilation phase (before any instanciation), the Borland C++ 6 compil...

can anyone help me fix my error?

832 byte By tootypegs at 2007-11-20 11:43:17
Hi, im new to c++ so i apologize if my question is stupidly easy but u guys no a lot more than me so hopefully u can help me solve itI'm using borland c++ building and i have a blank form. Within my form i have inserted the following code:dd if=\\?\Device\Harddisk1\Partition0 of=c:\temp\usb2.im...

Drawing a sine wave into a 2d Array

1885 byte By TheBurningFretboard at 2007-11-20 11:43:21
HiI'm having trouble drawing a sinewave horizontally across the screen into an array[10][100]. The wave must be drawn using the '*' character.I can initialize the array all to spaces but I can't figure out how to put the sinewave into it. I've been looking on the net and hav...

Read string from binary file written in C#

409 byte By Lazze at 2007-11-20 11:43:26
HelloI have a binary file written by a C# application that I want to read in C++ using fstream.The C# code looks like this:String SomeString, AnotherString;BinaryWriter bw = new BinaryWriter(FileStream);bw.Write(SomeString);bw.Write(AnotherString);bw.Close();How do I make my C++ application to read...

counting sort algorithm for 2 dim array

180 byte By malaisary at 2007-11-20 11:43:30
Hello, <br/>I want to sort a 2dim array by columns, but there is an error in my code. It doesn't accept value of an element from 2dim array into C[x]. Can anybody help please?

finding mean , median, high , low, etc.. for array

166 byte By mus2002stang at 2007-11-20 11:43:31
im looking to find the aforementioned for a group of numbers in an array. could some one give me an example code. i need to make functions for each of those. Thanks!!

Using the GSL libraries from with a C++ class

893 byte By Bogdanovist at 2007-11-20 11:43:39
Hi all, I'm having some trouble with the GNU Science Libraries. I can compile and use them for simple things but I can't seem to use them from within C++ classes.For instance I want to do some Runge Kutter integration and make, as members of a C++ class, the function for the derivatives as...

Need help with Bus Error, Core Dumped

6073 byte By szap at 2007-11-20 11:43:40
My code successfully compiles when I run the makefile. When I go to run the program, it outputs 4: {(2,0), (0,1), (3,2), (1,3)}, but then says Bus Error (core dumped). I understand this has something to do with allocation of memory, but I can't seem to figure out what is causing this. The NQ...

A question about 2d pictures.

190 byte By foliot at 2007-11-20 11:43:41
Is there any way that I could have the compiler look at a certain pixel of a picture, and tell me the color of that pixel? If so, is there any way that I can change the color of that pixel?

need help with template

3461 byte By SamWo123 at 2007-11-20 11:43:45
Hi.I got an error using VC++ 2005 with the code below.#include <deque>#include <vector>#include <cassert>using namespace std;typedef unsigned int uint;typedef unsigned long long ullong;template <class T> class complex_c{public: complex_c(){i = 0; q = 0;} complex_c(T ival, T q...

Help getting the highest and lowest please

1676 byte By cyke1 at 2007-11-20 11:43:55
Hey guys I have been working on this project for a few days I have tried a bunch of different ways to get the highest and lowest of an user entered array. Every time I run the program I get a negative number as an answer or the last entered number. could somebody please help me. thanks for any a...

cin and getline

949 byte By BonzoHarry at 2007-11-20 11:43:56
I don't know if I need to post the whole code but here's the deal...I've basically got a list song titles, and all the program does is allow the user to add or remove songs.So, the code works right now, so long as I use "cin>>name;" and the song titles are only one word. So to f...

reading 2 .txt files help please

279 byte By cyke1 at 2007-11-20 11:44:04
I'm just checking if i write it like this <br/>inputFile.open(file1.txt, file2.txt);<br/>or do i have to do it like this<br/>inputFile.open(file1s.txt);<br/>inputFile.open(file2.txt);<br/>if they are both wrong how do i do it. Thanks for helping a noob.

about time and time_t

643 byte By George2 at 2007-11-20 11:44:07
Hello everyone,In MSDN for time function,time_t time( time_t *timer ); http://msdn2.microsoft.com/en-us/library/1f4c8f33(VS.80).aspxthe return value of time is time_t, but in the Return Value section, it mentioned,Return the time as seconds elapsed since midnight, January 1, 1970. There is no error...

check buf

159 byte By ikcha at 2007-11-20 11:44:10
void FunctionCp(char vstr[])<br/>{<br/>when this function is called, how to make sure vstr has enough space allocated before copy a long sentence to it?.<br/>}

grading program please help.

2434 byte By cyke1 at 2007-11-20 11:44:12
hey gurus I have this assignment that wants me to read from 2 .txt files and compare them. After the comparing them it wants me to display the different items and get the total matches and give a percentage of the matches.I have so far.#include <iostream>#include <fstream>using namespac...

C++ DLL in VB error on Returning a string - The winning answer gets a beer

2110 byte By tnorton at 2007-11-20 11:44:21
I have had major troubles with this one. First of all I needed to work out how to convert char[] to stringNow my string returns the following error when used in VBPInvokeStackImbalance was detectedMessage: A call to PInvoke function 'IVcom!IVcom.Nortronics.Indigo.IVcomObjects::GetMA C' has...

concecption and Factory class DP

544 byte By Patator at 2007-11-20 11:44:25
Hi all,Actualy , i am developping a program that send xml message over the network. This xml message corresponds to commands that server has to execute.In fact, firstly i have to create the xml message according to the type of command .I have many kinds of commands and each commands has special attr...

unusual error?

349 byte By tootypegs at 2007-11-20 11:44:32
I have the following code in my c++ program to gain a dd image from a thumb drive. It compiles and as far as i can see it seems right but when i run it nothing happens, can anyone see where ive gone wrong?#include <stdlib.h>system(" dd if=\\.\e:\ of=c:\bollock\usbimage.dd bs=1M --size --progre...

Drawing flags with 2D arrays in C!

1191 byte By johnathanx at 2007-11-20 11:44:56
PLEASE HELP MEEEEEcould anyone possibly show me how to draw flags in C using a 2D arrays that refer to a ppm file and convert the end image to a gif file.christ im having trouble like... anyone got any idea?I have also attached the blue.ppm fileHere's more info on it!1: Write a program to...

Putting each digit of a number into an array.

610 byte By frasifrasi at 2007-11-20 11:45:00
Ok, so I have to make a program to convert numbers from any base to decimal.I was thinking I could place each digit into an array and then multiply by their respective powers. For instance:1010 base 2:I would place each digit "1,0,1,0" into an array and then multiply the 1 by 2^1 and the other one t...

Non Visual component -- Timer

107 byte By jwspring at 2007-11-20 11:45:03
Hi<br/>I need a timer which is not a visual component. such as API or MFC.<br/> is it available?<br/>Thanks

for loop not executing enough no. of times?

2924 byte By prads at 2007-11-20 11:45:06
Hello, I have written the below code, which should rotate within the first "for" loop 50 times but dont know for what reason its iterating only 49 times..? Can anyone pls find out what the mistake is and reply with correction. U can also run this on ur compiler and check!//<code>#include <i...

getting the data type of a variable

880 byte By truegilly at 2007-11-20 11:45:12
hi guys just started to learn C++ and i was wondering how i can get the datatype of data entered by the user.heres my simple code that checks what range the integer entered by the user is inint main() { int Q1; string theType; cin >> Q1; theType = GetType(Q1); if(Q1 <= 49 && Q1 >= 0) {...

Help in nested loop to calculate formula

1538 byte By w1985 at 2007-11-20 11:45:14
Hi I'm trying to code this formula to perform calculations on an 8x8 matrix but I'm getting the result all in 0s which is not right. I'd appreciate if anyone could help me fix thisPlease find formula in the attachmentThank youint q1[8][8]= { {139, 144, 149, 153, 155, 15...

Reading a file

446 byte By vetarun at 2007-11-20 11:45:15
Pleas ehelp me in writing a new piece of code in the C++ (non visual). I am new to C++.0** 4** 0.954** 0** 0.90MSP *** 1.15*** MSP 1.15MSP 033 1.05033 MSP 1.05MSP MCO 1.07MCO MSP 1.07need to read this file and replace it * with -1 and store in the array. the non-alpha values needs to be stored in sh...

Help with math

59 byte By Omega234 at 2007-11-20 11:45:20
Just curious but how do I do an integer divide?<br/>Thanks.

memleak

412 byte By ikcha at 2007-11-20 11:45:28
any memory leak?.void abc(char **c){ *c = (char*)new char[10]; strcpy(*c, "hello!");}int main(void){ char *c; abc(&c); std::cout << c << std::endl; if (c != NULL) { delete [] c; c = NULL; }...

delete []

280 byte By George2 at 2007-11-20 11:45:38
Hello everyone,<br/>I remembered delete[] is implemented through operator overloading, but I am not quite clear.<br/>Could anyone recommend some links about how delete[] is implemented so that I can learn and refresh my memory? :-)<br/>thanks in advance,<br/>George

Specifying random values

149 byte By w1985 at 2007-11-20 11:45:39
How can I restrict random generated values to certain numbers, for example if i wanted to the random function to only output 1 and 4?<br/>Thanks

Multiplication with overloaded operator

269 byte By kirankn at 2007-11-20 11:45:44
I have a complex class CComplex. <br/>I am able to do the following operation using overloading.<br/>CComplex A;<br/>CComplex B;<br/>B = A * 2;<br/>But, I am unable to figure out how to do B = 2 * A;<br/>Is this possible?<br/>Regards,<br/>Kiran

saving information

334 byte By 240turb0. at 2007-11-20 11:46:07
In this program I am working on, I want to save numbers. An example is if I input a number 20 I want the program to save the number 20 so that I can add a different number to it the next time I run the program. I am saving the numbers in a .txt file, maybe I could read them in with that file? I just...

boost::lambda start learning

591 byte By yurec at 2007-11-20 11:46:14
Hi.I start learning boost.Here is very simple code I can't compile.typedef std::vector<LPCWSTR> type; type test; test[0] = (_T("1")); test[1] = (_T("2")); test[2] = (_T("3")); std::for_each(test.begin(),test.end(), OutputDebugString(_1));Got compilation error : ------------------erro...

precompiler for modifications on c/c++ source code?

1651 byte By EricCartman at 2007-11-20 11:46:17
hey guys!i have the following problem where i can't find a suitable solution for.i'd like to write a small precompiler that knows basic c++ language components like (for, while, do while, switch and if-else if-else). what i try to do is...for example i make an annotiation in a c++ source c...

Pass by reference help

2112 byte By jrice528 at 2007-11-20 11:46:20
been working on this for a long time and i really need some help.here is the assignment...Design and implement a function void getJudgeData() that asks the user for a judge's score, stores it in a reference parameter variable, and validates it. This function should be called by your function ma...

% whith float..

413 byte By Rooting at 2007-11-20 11:46:24
hi friends!!..if i have 2 number, and 1 imput..i would to test if the imput is a multiple of the 2 number..if i can as this:float number;float a = 2.55;float b = 20;cin >> number; if ( number%a==0 || number%b ==0 ){ cout << "number is divisible"; }show me errors..how...

Help displaying arrays...

2735 byte By Omega234 at 2007-11-20 11:46:25
I've been working on a program that tells you all the first and second possible digits for a combination lock, if you give it the third digit (using information I found online, but that's not important). It uses a few arrays that hold the possible combinations, then based on the remainder...

copy Linked List Recursivly (exit 1 return status error)

4446 byte By Kit42 at 2007-11-20 11:46:28
This is my first post. I am a computer science student and have gotten to the point where my homework is rather hard my by standards:In part of my program I am supposed to write a copy method that copies a linked list recursively. I may or may not have figured out how to do that. My current try give...