3,892 Posted Topics

Member Avatar for Maux

[quote=Maux;251750]I'm new to these forums,and really new to C++,but here is what i need to know.I made a simple calculator in C++ and i was wondering what i need to be able to keep useing it without opening the program everytime... [code]// simple calc // Chris Wilson #include <iostream.h> int …

Member Avatar for rinoa04
1
128
Member Avatar for gampalu

How about starting with this: [URL]http://www.daniweb.com/techtalkforums/thread50370.html[/URL] Hope it helped, bye.

Member Avatar for gampalu
1
94
Member Avatar for himanjim

[quote=himanjim;251957]unsigned int a =0xffff; ~a; printf("%x",a); gives output ffff Complementing function works here. What's use of 0x in 0xffff as unsigned int is of 2 bytes only??? Can anybody suggest???[/quote] Correction: size of unsigned int on normally all machines is 4 bytes that is 32 bits. Only that you specified …

Member Avatar for Dave Sinkula
1
539
Member Avatar for dsraju

Yes, i think maybe you are wokring on a 16 bit compiler like Turbo C. Move on to some newcompiler and try your code then. If still error persists post here. Look for the list of free IDE and compilers here. [URL]http://www.daniweb.com/techtalkforums/thread50370.html[/URL]

Member Avatar for ~s.o.s~
0
145
Member Avatar for CurtisBridges

Yes just follow Mr. Anonymusius's advice and keep some things in mind: 1. Avoid the use of global variables since its a bad programmign practice. 2. If you dont know pass by reference make the function return the updated total. That looks like a good programmign practice :) 3. Another …

Member Avatar for CurtisBridges
1
120
Member Avatar for Marthy

Hey Micko, your program properly compiles and gives the expected output. What problem are you facing ???? My output: [quote] 6.8, 11.2 Press ENTER to continue. [/quote] Hope it helped,bye.

Member Avatar for Micko
1
106
Member Avatar for whitemoss

[quote=whitemoss;250451] [code] #include <mysql.h> #include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #include <string.h> #include <stdlib.h> void error(char *msg) { perror(msg); exit(0); } int main(int argc, char *argv[]) { MYSQL *conn; MYSQL_RES *res; MYSQL_ROW row; char *host = "192.168.2.11"; char *user = "daily1a"; char *password = "daily2006"; char …

Member Avatar for whitemoss
1
143
Member Avatar for Gigs_

.X files are basically Microsoft format of 3d model files which are used in the game development industry for storing the 3D model information. And as far as manipultaing them is concerned, you can use a 3d Modeling tool like Blender to make your own .X files and change existing …

Member Avatar for ~s.o.s~
1
96
Member Avatar for the.future.zone

Yes what Mr. Hollystyles said is right. Btw i hope you dont mean to ask something like: [code] int* a = NULL ; int* b = NULL ; // some operation and allocating memory to ptrs. // a and b point to the same mem. location // address in "a" …

Member Avatar for ~s.o.s~
2
119
Member Avatar for linq

It must be somthing in your source code which might be causing this problem. Also mention the files which are present in your current project. Did you mess with the settings of the directories and so on. Post entire thing, and we will see what can be done.

Member Avatar for ~s.o.s~
1
320
Member Avatar for anksphenomenon

C++ can as such achieve any possible task you can think about. The only problem is the GUI support doenst come along with C++ so you would have to use GTK (graphic tool kit) to achieve the graphics related functionality. To help you out with some of the most common …

Member Avatar for anksphenomenon
1
703
Member Avatar for viki

The first step in solving the problem is to identify the problem domain properly. Dig out some information on partial fraction decomposition, try to formulate a basic algorithm (the sequence of steps you would follow in achieving the objective). To start off with, just post a basic algorithm on achieving …

Member Avatar for DavidB
1
707
Member Avatar for kimw

The link below includes the configuration of newmat library in depth along with few examples. [URL]http://www.unc.edu/courses/2004fall/psyc/285/001/NM10.htm#gcc[/URL] Hope it helped, bye.

Member Avatar for ~s.o.s~
1
100
Member Avatar for dsraju

@Andor Asssuming that the elements in the two dimensional array are contiguous doesnt necessarily hold true. For performace reasons, the data is aligned with the byte boundaries (which in the case of 32 bit computers is 4 bytes). So an optimizing compiler might leave in empty spaces or gaps between …

Member Avatar for ~s.o.s~
1
139
Member Avatar for codeme

Just searching for the code to do something or to complete a project is no substitute for solving the problem by putting in your genuine effort. If you want to solve or make this project why not consider it as a fun exercise and try your own hand at it. …

Member Avatar for ~s.o.s~
1
169
Member Avatar for Mushy-pea

Hey there, welcome to the community and be ready to join the fray (just joking). Hope you enjoy it here and get all the help that you wanted. And yes I think Miss Dani started this forum under her own name (Dani Dani... yeah man i love saying it.) Best …

Member Avatar for happygeek
1
106
Member Avatar for vinay raja

Some points to point out in your code: 1. [inlinecode]int main (void)[/inlinecode] is the correct prototype for the main function and not void main. 2. Dont use [inlinecode]#include <conio.h>[/inlinecode] which is console based I/O library, it kills program portability. 3. Dont use old style headers in C++. Use something like …

Member Avatar for WaltP
0
574
Member Avatar for Maxxpower

It would really benefit to you if you could read on some introductory material to the C++ programming language or some newbie book like "Sams Teach yourself C++ in 21 days" to get the hang of the subject. This forum will help you definately if you get stuck in your …

Member Avatar for ~s.o.s~
1
140
Member Avatar for aaholland

[quote=aaholland;250858]Thanks for all the help I got a 97% on the project. :)[/quote] Congratulations, just keep on putting effort in your work and the rewards will definately come back to you. And if you encounter any other problem just dont hesitate to ask it. Hope you are enjoying your stay …

Member Avatar for ~s.o.s~
1
98
Member Avatar for smagee12
Re: glut

[quote=smagee12;250730]In a statement like this It appears that im trying to count the mouse clicks, but of course this wouldnt work. After the function call is done for void mousebuttonhandler counter is deleted. I am brand spanking new to glut and i can't really think of away to accomplish counting …

Member Avatar for ~s.o.s~
1
121
Member Avatar for Natrius

[B]1.[/B] I'm making a program with a default constructor and an overloaded constructor. They're both called by different rules and produces a testline of text when called. The assignment is to give the overloaded constructor default arguments to see what happens. I wonder, what is a default argument i an …

Member Avatar for WolfPack
1
167
Member Avatar for Iqbal_h_a

[quote=Iqbal_h_a;250465]Sorry for my ignorance. As I am new to this blog, I was unaware of the rules. I tried to edit the post as you suggested, but could not do so. I will definitely take care of all the rules in my future posts. I am extremely sorry if I …

Member Avatar for ~s.o.s~
-1
200
Member Avatar for linq

[quote=linq;250509][code] #include "stdafx.h" #include <iostream> using namespace std; int a=10; [B] void[/B] main() { a=20; cout<<a<<endl; cout<<::a<<endl; } [/code] [/quote] BTW just as a reminder, [inlinecode] main (void) [/inlinecode] doesnt return [inlinecode]void[/inlinecode], it returns an [inlinecode]int[/inlinecode] which is the signal to the operating system about the execution status of the …

Member Avatar for ~s.o.s~
1
112
Member Avatar for mom2006

Please post your own effort and then we will see what can be done to help you out. Just asking for a source code file would do you no good and beats the purpose of doing engineering.

Member Avatar for ~s.o.s~
1
476
Member Avatar for becki

[quote=Lutzee;249590]Hey Becki, Im not that good a coder and this program is unweildy and long but you could implement it like this: [code] #include <iostream> using namespace std; [COLOR=Sienna] [/COLOR][COLOR=Sienna]// not a good programming practice to declare global variables. // this beats the intended use of the best object oriented …

Member Avatar for WaltP
1
190
Member Avatar for Daijing

Yes maybe something along the lines what Mr. GloriousEremite has given should solve your problem. [code] int main (void) { ifstream in_file ; // start of naked block according to the principle of least // data exposure. { string file_name ; cout << "Enter the name of the file: " …

Member Avatar for ~s.o.s~
1
194
Member Avatar for kimw

The best way to start learning a library is reading its documentation properly and visiting the related forums. If you still feel that you are lost then you need to do a check whether you really prepared to handle this project. Hope it helped, bye.

Member Avatar for kimw
1
183
Member Avatar for hygy486

Understanding you problem domain in the first step in solving a problem. If the above assignment would have been in Java it would have been simple matter of using Applet to draw the lines and circles but as it is in C you need to use an external library to …

Member Avatar for Ancient Dragon
2
204
Member Avatar for hygy486

Yes you better follow the guidelines laid down by Wolfpack to solve your problem but while finalizing your code just replace the `scanf` with either `getchar ()` for gettign a character or `fgets ( )` while getting a string. `scanf` is a prettly complex function and leaves the input stream …

Member Avatar for ~s.o.s~
0
2K
Member Avatar for comp_sci11

Instead of using Libraray which draws out jagged circles and which are non standard, better start using OpenGL since it has the same learning curve as that of your BGI (atleast for the basic things) and is much more useful and much more fun. For eg. if you have to …

Member Avatar for ~s.o.s~
2
168
Member Avatar for bh_hensem

The algorithm for cleaning out duplicates from a dynamic array has the following procedure: 1) Store the current record in the variable. 2) Using a compare function, compare the current variable with each and every variable of the dynamic array storing the records. 3) Whenever a match is found, delete …

Member Avatar for Bench
1
154
Member Avatar for VinC

For absolute beginners, i would recommend "C++ in 21 days" and if you want to move ahead from the beginner stuff i would recommend "C++ programming language". Hope it helped, bye.

Member Avatar for VinC
1
127
Member Avatar for ze_viru$

[code] #include<iostream> using namespace std; void Compare(int[],int[],bool [],int); void acceptInput (int [], int []); void displayResult (bool []); int main() { const int arraySize = 5; int CorrectArray[arraySize]; int PupilArray[arraySize]; bool ResultArray[arraySize] = {false}; acceptInput (CorrectArray, PupilArray); Compare(CorrectArray,PupilArray, ResultArray, arraySize); displayResult (ResultArray); return 0; } void Compare(int correct[],int pupil[],bool Result[],int …

Member Avatar for mostafadotnet
1
124
Member Avatar for muhammad amir

[B]O-notation [/B]The Θ-notation asymptotically bounds a function from above and below. When we have only an asymptotic upper bound, we use O-notation. For a given function g(n), we denote by O(g(n)) (pronounced "big-oh of g of n" or sometimes just "oh of g of n") the set of functions O(g(n)) …

Member Avatar for Grunt
1
151
Member Avatar for jahnavi

[quote=jahnavi;248624]Plz send code for implementation of shuffle game using c and Graphics. Thanq[/quote] Instead of thanking us, it would be really useful if you post your attempt at the current problem and then we will see what can be done. Hope it helped, bye.

Member Avatar for ~s.o.s~
-2
82
Member Avatar for padmakar

It basically depends on the kind of feat you are trying to achieve. Well if you want to go for normal playing of audio files you can try the above methods. But if you want to manipulate the sound stream like in games you can try out the open source …

Member Avatar for ~s.o.s~
1
104
Member Avatar for SHWOO

[quote=SHWOO;248471]Can anyone figure out why I get -9.032654e something from my biWeeklySalary function? [code] #ifndef EMPLOYEE_H #define EMPLOYEE_H #include "HireDate.h" #include <string> using std::string; class Employee { public: Employee(); Employee( const string &, const string &, const string &, const HireDate & ); ~Employee(); void setFirstName( const string & ); …

Member Avatar for Salem
1
271
Member Avatar for Allisone

[code] Program V:= { 1234567; Subroutine I-executable:= { loop: file = random-executable; // select a random executable file if (first line of file = 1234567) then goto loop; else prepend V to file; } Sub-routine display-message:= { count = 1000; if (count is 0) then exit from sub-routine display-message; else …

Member Avatar for ~s.o.s~
0
162
Member Avatar for brianotieno

Mr. Brian it would be really an intelligent strategy to split your code in small modules if you encounter any problems or bugs in your code. This is guaranteed to provide you a rough idea where you have gone wrong since then your errors would be more localized to a …

Member Avatar for Dave Sinkula
0
235
Member Avatar for grunge man

Read this [URL]http://www.cplusplus.com/doc/language/tutorial/variables.html[/URL] and this [URL]http://goforit.unk.edu/cprogram/c_008.htm[/URL] Hope it helped, bye.

Member Avatar for dwks
0
246
Member Avatar for JW1873

Please friend, it would really be appreciated if you atleast give it a try before completely giving up and waiting for the others to answer your questions. A real programmer has a hell of a fighting spirit so try your level best and then if any problem occurs just let …

Member Avatar for mostafadotnet
0
250
Member Avatar for ishwar

[quote=Ancient Dragon;246474]std::string.substr() returns another std::string.and you can't mix C and C++ like that. you would need to allocate space for the substring [code] char * str = NULL; string str2 = "hello"; string str3; [COLOR=Red]str = (str2.substr(2,4)).c_str();[/COLOR] [/code] [/quote] Mr. Dragon, wont this work or do the same trick or …

Member Avatar for ishwar
0
22K
Member Avatar for akadri

Compiler list and starting resources. [URL="http://www.daniweb.com/techtalkforums/thread50370.html"]http://www.daniweb.com/techtalkforums/thread50370.html[/URL]

Member Avatar for WaltP
1
261
Member Avatar for Dave Sinkula

Coffee for me. One cup of hot steaming coffee and i am in seventh heaven. Provides me with all the relaxation i need. COffee anyone... ;)

Member Avatar for UrbanKhoja
0
1K
Member Avatar for Eddy Dean

I thought i would help but am getting this output. [code] Starting to get XTEA key XTEA Key: Characters put inside buffer Original buffer: ◄♣¶ orig casted: ◄♣¶ Encrypting... finished encrypting... encrypted: -ÿ ä- starting to decrypt... finished decrypting, value of retbuf: end of decrypt: ╥ÿφ4╩╠≈⌠½½½½ε■ε■ Decrypted: ╥ÿφ4╩╠≈⌠½½½½ε■ε■ Size of …

Member Avatar for Eddy Dean
0
1K
Member Avatar for Gunner54

One last and serious word from me, dont try to post code which you yourself havent written. IF you still have problems understanding the code then goto the original location from where you have picked this code or to the person who has given you this code. It would really …

Member Avatar for Gunner54
0
812
Member Avatar for hay_man

Maybe something like [code] #include <iostream> #include <string> using namespace std; const int tokenLength = 4; int main (void) { string str = "12345678"; int strLength = str.length(); if (0 != (strLength % 4) ) exit (1); char* temp = new char [5] ; memset (temp, 5, '\0'); int sum …

Member Avatar for Ancient Dragon
0
234
Member Avatar for grunge man

Err.. buddy , it would be best you not resurrected dead threads. It would be really good if you just looked at the date of the last reply of a thread before posting in it. And by the way, the thread has been marked solved so please dont post in …

Member Avatar for grunge man
0
754
Member Avatar for grunge man
Re: ????

POsting your code properly means : 1) List the basic logic and the purpose of your program ie what it is supposed to achieve. 2) List the unexpected behaviour that your program is displaying and if you are getting errors list the log file of errors. 3) Properly indent the …

Member Avatar for Bench
0
290
Member Avatar for himanjim

[quote=himanjim;245753]FILE *ptr; char i; ptr=fopen("file.c","r"); while((i=fgetc(ptr))!=Null) printf("%c",i); leads to infinite loop??? but while(fgets(str,80,ptr)!=NULL) puts(str); on the similiar terms doesn't???[/quote] Maybe because [inlinecode] fgetc () [/inlinecode] returns EOF when end of file is reached or an error is encountered hence your loop never terminates while [inlinecode] fgets ( ) [/inlinecode] returns …

Member Avatar for Salem
0
166

The End.