1,171 Posted Topics

Member Avatar for wonder_laptop

What exactly do you want? You should explain every detail to increase your chances of getting helped by forum members ...

Member Avatar for Lerner
0
125
Member Avatar for jenilgandhi

I don't know much about C, but I think it's something like this: [CODE=c] #include <stdio.h> #include <stdlib.h> int main() { /* Create pointers */ int * matrix_one; int * matrix_two; /* Dynamically allocate memory for our matrices */ matrix_one = (int*) calloc(50, sizeof(int)); matrix_two = (int*) calloc(50, sizeof(int)); /* …

Member Avatar for monkey_king
0
91
Member Avatar for hansel13

[QUOTE=hansel13;822867] Now if I type in any word that begins with q or Q, it returns false. Is there away to avoid this? Because I only want the letters q and Q to return false. Not words that begin with q or Q.[/QUOTE] To avoid this problem you should just …

Member Avatar for hansel13
0
189
Member Avatar for arshad115

Hmm, this makes me thinking about an override somewhere in your program ... What happens if you change: [CODE] int x=astrlen(s1); int y=astrlen(s2); [/CODE] To: [CODE] int x=astrlen(s1)-1; int y=astrlen(s2)-1; [/CODE] ????

Member Avatar for ArkM
0
253
Member Avatar for NagendraR

Maybe you want to take a look at my code: [CODE=cplusplus] #include <iostream> using namespace std; void func(char **& ref_to_ptr); /* Function declaration */ int main(void) { /* Declare the '2D Array' */ char ** ptr = new char * [5]; ptr[3] = new char[20]; /* Put some data in …

Member Avatar for tux4life
0
243
Member Avatar for idb_study

You can use them e.g. for a table of char-strings: [CODE=cplusplus] #include <iostream> using namespace std; int main(void) { /* Declare the '2D Array' */ char ** ptr = new char * [5]; ptr[0] = new char[20]; ptr[1] = new char[20]; ptr[2] = new char[20]; ptr[3] = new char[20]; ptr[4] …

Member Avatar for tux4life
0
154
Member Avatar for peacerosetx

I like your way of thinking ;) , but in most cases the compiler also mentions where (on which line) the error is located... Didn't the compiler give the line where there was a missing ')' ?

Member Avatar for peacerosetx
0
536
Member Avatar for arshad115

-> You get input using 'cin' (e.g. : 'cin >> var;') -> If you store your results you got from the user into an array declared in the function, it is only accessible by the function, not the whole program, you can declare a global array ([B][U]NOT RECOMMENDED![/U][/B]) but it …

Member Avatar for tux4life
0
2K
Member Avatar for Drake

Definition (?) of a compiler: [CODE] -> A computer program which reads source code and outputs assembly code or executable code -> A computer program that translates highlevel code into machine code [/CODE]

Member Avatar for tux4life
0
94
Member Avatar for fourstar

I know there's also a seperate thread about C++ Books, but 'C++ Black Book' is a very beginner-friendly book, it explains nearly the whole C++ syntax in detail, step by step ... But it might not be an appropriate choice for you because you only need to learn the basics... …

Member Avatar for tux4life
0
335
Member Avatar for rickster11

Maybe you should take a look at the following code: [CODE=cplusplus] #include <iostream> #include <string> using namespace std; int main(void) { string usrInput; double dbl = 0; cout << "Enter a percent: "; getline(cin, usrInput); cout << endl; if(usrInput.c_str()[usrInput.length()-1] == '%') { usrInput.replace(usrInput.length()-1, 0, ""); cout << usrInput << endl; …

Member Avatar for tux4life
0
179
Member Avatar for 10Pints

Maybe you should take a look at the following link: [URL="http://msdn.microsoft.com/en-us/library/et4zwx34(VS.71).aspx"]http://msdn.microsoft.com/en-us/library/et4zwx34(VS.71).aspx[/URL] Can you also post all the includes you did in word.cpp? Can you also list the contents of your 'c:\data\dev\cms\3.0.0.0\code\word\src' ?

Member Avatar for 10Pints
0
252
Member Avatar for jeevsmyd

[QUOTE=siddhant3s;818301]You have a internet connection. So go and get "Decent Book" Be with the Standard C++ and just pour all that crap on your answer sheet in the examination , what your teacher expects from you.[/QUOTE] Totally agreed with that:$, it's better to learn the new C++ standard instead of …

Member Avatar for Narue
0
169
Member Avatar for tux4life

Hello, My problem is that the program always gives the same output: [CODE]There were no matching numbers !!![/CODE] The source of my program looks as follows: [CODE=cplusplus] #include <iostream> using namespace std; int main(void) { const int MAX_CHARS = 500; const int MAX_NUMS = 5; const int MAX_NUM_CHARS = 25; …

Member Avatar for tux4life
0
137
Member Avatar for 94SupraTT

I'm just doing what djextreme5 advised you: [QUOTE=djextreme5;817676]You can make a variable and put it as the last line in your loop and output the variable that you created AFTER the loop has finished.[/QUOTE] Try the following code: [CODE=cplusplus] #include <iostream> using namespace std; int main(void) { int i; for(i …

Member Avatar for tux4life
0
79
Member Avatar for tux4life

While searching the internet I always come across several posts where they're saying that Bloodshed Dev-C++ isn't for advanced use (rather for newbies), why are they saying that? Is MinGW not an advanced compiler? Or is it just because they aren't developping Dev-C++ anymore... I know there's Code::Blocks, but I …

Member Avatar for tux4life
0
170
Member Avatar for tyoung4@runner

Maybe you should try the following code: [CODE] #include <iostream> #include <cstdlib> using namespace std; int main() { system("cls"); double distance, mph, hours; //Get the data cout << " What is the speed of the vehicle in MPH? "; cin >> mph; cout << " How many hours has it …

Member Avatar for tyoung4@runner
0
305
Member Avatar for ox99racer

What you need is a good book about C++ (and you also have to read it, otherwise it won't be a good practice). Please check the following thread about C++ books: [URL="http://www.daniweb.com/forums/thread70096.html"]http://www.daniweb.com/forums/thread70096.html[/URL] I personally can recommend the "C++ Black Book", one of the best C++ books ever written, if you …

Member Avatar for tux4life
0
110
Member Avatar for nick2price

Hmm, seems like it can't find the file 'sys/time.h' What IDE and compiler are you using? (With me this program just compiles/runs perfectly, I'm using the latest MinGW compiler together with the latest Code::Blocks IDE)

Member Avatar for tux4life
0
259
Member Avatar for mtramnes

First of all a few recommendations: - Use '#include <iostream>' instead of '#include <iostream.h>' unless your compiler doesn't support it - Your main function should return a value: for example put 'return 0;' at the end of the main function Ok, now we're taking a look at what exactly you …

Member Avatar for vmanes
0
118
Member Avatar for tux4life

I'm fairly new to C++ programming and I would like to ask you a (maybe strange) question... The code below compiles correctly with both: - the latest MinGW-compiler - Borland C++ Builder Compiler 5.5 (from the free Command Line tools) However if I run the program (after compiling with the …

Member Avatar for tux4life
0
368

The End.