Search Results

Showing results 1 to 40 of 61
Search took 0.01 seconds.
Search: Posts Made By: number87 ; Forum: C++ and child forums
Forum: C++ Oct 26th, 2009
Replies: 3
Views: 265
Posted By number87
ohh....I didnt include the setprecision and std::fixed. But if I include it, my code still doesnt print right. 500.00 as a string the float just becomes 50000.00

This is exactly what I did in my...
Forum: C++ Oct 26th, 2009
Replies: 3
Views: 265
Posted By number87
I am trying to convert a string "500.00" into float.

When I use this it produces a string 50000, why does it produce such a result?

atof(bal.c_str());
Forum: C++ Oct 24th, 2009
Replies: 1
Views: 317
Posted By number87
ok so I am trying to read in a file. Do some string checking. And output the counters. But somehow I think something is wrong with my strcmp. And I do not know where is the problem. Everything...
Forum: C++ Oct 8th, 2009
Replies: 4
Views: 251
Posted By number87
thanks alot for explaining!
Forum: C++ Oct 8th, 2009
Replies: 4
Views: 251
Posted By number87
will atoi(text[0]) work too?
because doing atoi("0") is hardcoding....
Forum: C++ Oct 8th, 2009
Replies: 4
Views: 251
Posted By number87
I got a question about c++ strings.

Let's say string text = "0R14"

and I access each element using text[0],text[1] etc

does text[0] return an integer 0? or a character '0'?

if it doesn't...
Forum: C++ Aug 13th, 2009
Replies: 5
Views: 365
Posted By number87
i++ or i+= will not work because the compiler doesnt allow such operations for enum iterations
Forum: C++ Aug 12th, 2009
Replies: 5
Views: 365
Posted By number87
by the way this is my main when I run the program for testing

int main()
{
print_shortest_path(changi, bedok);

system("pause");

}
Forum: C++ Aug 12th, 2009
Replies: 5
Views: 365
Posted By number87
I am doing a program to print out the shortest path between locations. I implemented it using a 2D array for the adjacency matrix.

However, when I run it and input the start and end locations,...
Forum: C++ Aug 12th, 2009
Replies: 3
Solved: typedef enum
Views: 1,436
Posted By number87
so C doesnt have bool defined that's why they need to define it like that?
Forum: C++ Aug 12th, 2009
Replies: 3
Solved: typedef enum
Views: 1,436
Posted By number87
what's wrong with this line when I try to compile in C++?? The src code was originally in C. It gets an expected identifier error with my c++ compiler

typedef enum {false, true} bool;
Forum: C++ Feb 24th, 2009
Replies: 1
Views: 681
Posted By number87
So basically I am creating a client/server kind of program. The client/user enters a question eg "Who are you? "
The server part receives this and checks it with a txt file and returns eg "I am a...
Forum: C++ Feb 17th, 2009
Replies: 8
Views: 1,139
Posted By number87
forgot to mention that in my above post, but i tried putting the braces as you advised too. Both removing and changing the position of the braces resulted in the program doing nothing. Im not new to...
Forum: C++ Feb 17th, 2009
Replies: 8
Views: 1,139
Posted By number87
hmm i removed those braces and got the same results as I posted before.
Forum: C++ Feb 16th, 2009
Replies: 8
Views: 1,139
Posted By number87
ok so now my code compiles properly. However, it doesnt work. I am able to input a question like How are you?
but nothing else happens. It should be able to create a fork and the server side of my...
Forum: C++ Feb 15th, 2009
Replies: 8
Views: 1,139
Posted By number87
the error is the recv_data type is not the same as my vector strings (qns and ans). So I am unable to string compare. And this is kind of a problem for me
Forum: C++ Feb 15th, 2009
Replies: 8
Views: 1,139
Posted By number87
So, what Im trying to do here is a client server socket program. The client will ask a question to the server. For example, How are you?
Then the server opens a text file, compares the string from...
Forum: C++ Feb 8th, 2009
Replies: 11
Views: 826
Posted By number87
thanks for the help so far. I have changed all my test functions and all of them work except for counting the total size of files in bytes. I know that strings do not allow integer calculations. So,...
Forum: C++ Feb 8th, 2009
Replies: 11
Views: 826
Posted By number87
ok here's my updated and corrected code. Compiles fine. But when I run the command ls -ali | ./a.out in Unix, I get a segmentation error. Am I missing a library?

#include <iostream>
#include...
Forum: C++ Feb 8th, 2009
Replies: 11
Views: 826
Posted By number87
oh I did that because of an example I saw. And it's the only example out there which is in line with what I want to do...
which is the break the input line into different fields and check only...
Forum: C++ Feb 8th, 2009
Replies: 11
Views: 826
Posted By number87
oh didnt notice i copied the code twice lol just ignore the copied one
Forum: C++ Feb 7th, 2009
Replies: 11
Views: 826
Posted By number87
I did a program to read the output of the UNIX command ls -ali
and count the number of directories, write files, link files etc.
But there seeems to be something wrong with my code and I cant...
Forum: C++ Feb 5th, 2009
Replies: 7
Views: 637
Posted By number87
ok so i came up with this code, seems that I have a compilation error and I cant seem to figure out why

#include <iostream>
#include <cstring>
using namespace std;

int main()
{
char...
Forum: C++ Feb 5th, 2009
Replies: 7
Views: 637
Posted By number87
so there is no other functions to find out the file type (dwrx) other than to check the string (dwrx etc...) if im not allowed to use stat functions?

because if this is the situation, and I...
Forum: C++ Feb 4th, 2009
Replies: 1
Views: 603
Posted By number87
hi guys its my first time doing a c++ program to manipulate shell input
I need to create a c++ program which reads input from this unix shell command >> ls -ali
and then im supposed to count the...
Forum: C++ Feb 4th, 2009
Replies: 7
Views: 637
Posted By number87
someone help plssss:-/
Forum: C++ Feb 3rd, 2009
Replies: 7
Views: 637
Posted By number87
so to clarify, will mode_t work if I use it with pre defined macros such as S_IFDIR , S_IFLNK , S_IRUSR ?? or is it a must to use them with st_mode??

for example if I wanna do a file checking...
Forum: C++ Feb 2nd, 2009
Replies: 7
Views: 637
Posted By number87
Hi guys I just wanna ask what is the difference between the mode_t and st_mode when using sys/stat.h and sys/types.h libraries. I looked them up google and find most people use st_mode but never...
Forum: C++ Nov 21st, 2008
Replies: 5
Views: 1,595
Posted By number87
ah ok i get what u mean
Forum: C++ Nov 20th, 2008
Replies: 5
Views: 1,595
Posted By number87
ok what im trying to do have a list of Events (which are actually a struct type containning data such as time date etc). And my problem as can be seen above is that I do not know how to resolve their...
Forum: C++ Nov 20th, 2008
Replies: 5
Views: 1,595
Posted By number87
I am creating a linked list which links a struct of data together. However, this is my problem, if I declare struct Node first then the Event type wont exist, but if I declare struct Event first then...
Forum: C++ Nov 17th, 2008
Replies: 6
Views: 422
Posted By number87
oh dang didnt notice i used cout twice...must be the stress...

and its working now :) thanks all for the help
Forum: C++ Nov 17th, 2008
Replies: 6
Views: 422
Posted By number87
ok so...i did something about the display functions and got this but it doesnt seem to work....
can someone explain how a function from another class calls a function for a diff class??....coz i...
Forum: C++ Nov 17th, 2008
Replies: 6
Views: 422
Posted By number87
ok basically what my program is about. I am to create a program that allows users to input aircraft/cargo details, add the cargo to the aircraft(up to 20), and a function to display all the cargo on...
Forum: C++ Nov 4th, 2008
Replies: 8
Views: 734
Posted By number87
this is very weird LOL
i deleted the #include <cstring> and the ' ' around *text

IT WORKED! soooo weird
Forum: C++ Nov 4th, 2008
Replies: 8
Views: 734
Posted By number87
invalid conversion from `char**' to `int'
Forum: C++ Nov 4th, 2008
Replies: 8
Views: 734
Posted By number87
ok i tried that and......it created another error....
Forum: C++ Nov 4th, 2008
Replies: 8
Views: 734
Posted By number87
so correct me if im wrong...i read the text file, then put the characters into an array, and im pretty sure *text in check = isalpha('*text'); refers to a single array element....

ahhh....still...
Forum: C++ Nov 4th, 2008
Replies: 8
Views: 734
Posted By number87
ok so what im trying to do is to read some text from a file. Put them into an array. And count the number of characters in the text file using pointers to access the array. However, when i compile i...
Forum: C++ Oct 14th, 2008
Replies: 9
Views: 2,937
Posted By number87
thanks Ancient Dragon for explaining.

however i tried creating a tm structure outside the int main() function and it always doesnt work. It seems to only work in int main(). I can't figure out...
Showing results 1 to 40 of 61

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC