Posts
 
Reputation
Joined
Last Seen
Ranked #303
Strength to Increase Rep
+8
Strength to Decrease Rep
-2
100% Quality Score
Upvotes Received
17
Posts with Upvotes
15
Upvoting Members
12
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
14 Commented Posts
0 Endorsements
Ranked #377
~79.9K People Reached
Favorite Forums
Favorite Tags

190 Posted Topics

Member Avatar for rodeostar04
Member Avatar for justinlake888

Here's an idea: First check is your number teen, or not. If it is teen number (1 is first digit) then check second digit and write: [CODE=cplusplus] //just for example case 1: str = "Eleven"; break; case 2: str = "Twelve"; break; //... [/CODE] if it's not teen number, then …

Member Avatar for hermel
0
2K
Member Avatar for themaestro

[QUOTE=themaestro;1353847]Thanks for the reply. The code above only writes "time exceeded" after the person has finished the quiz. Is it possible to prompt the command even if the user doesnt enter anything? Lets say he's only less than halfway through the quiz.[/QUOTE] It is possible, and it is called "threading". …

Member Avatar for viorel994
0
3K
Member Avatar for cam875
Member Avatar for jared_masc

And yet, scanf can be clever function: [CODE=c] #include <stdio.h> int main(){ char dump, string[40]; printf("Enter whole sentece (yeah, bring spaces too, I can handle it):\n"); scanf ("%[^\n]", string); scanf("%c", &dump); printf ("You entered: %s", string); return 0; } [/CODE]

Member Avatar for deceptikon
0
5K
Member Avatar for onemanclapping

Unix has various flags. It doesn't have to do with makefiles. Try writing instead of _UNIX: _unix, unix, _UNIX_, UNIX... etc... The best thing is: see what compiler are you using, and then look at its documentation, because compilers are setting those flags, and different compilers name different names (for …

Member Avatar for Ancient Dragon
0
2K
Member Avatar for davidTechy

1. You are making memory leaks all over the place. When you operate with dynamic memory allocation you have the responsibility to free every part of memory that you don't use. 2. Instead of [ICODE]void main()[/ICODE] always write [ICODE]int main()[/ICODE] 3. myRemove() isn't working. Why are you creating a new …

Member Avatar for WaltP
0
3K
Member Avatar for animefun2

>I'm using Visual C++ and doesnt give me any compilation error it keeps giving me a run time error after i enter the 1st number i can't figure out whats wrong :S help?[/QUOTE] The only reason this code should give you error is if you input something else that float, …

Member Avatar for abhishekjha
0
258
Member Avatar for Trekker182

I guess you defined float stars[20][20]? You can't write stars[i] + stars[j], because you have to write two dimensions (two brackets): stars[i][j]... always. hth

Member Avatar for raptr_dflo
0
255
Member Avatar for n8thatsme

Never test end of file with .eof()!!! It's wrong. Instead, replace [ICODE]!indata.eof()[/ICODE] with [ICODE](indata>>info)[/ICODE] (and of course, remove same line after while)

Member Avatar for mike_2000_17
1
4K
Member Avatar for Hatem Faheem

Line 8 of your code is: string constructor (string str, int number) Line 9 of your code is: string constructor (char* arr, int number) It's been awhile since I wrote in c++, but i think you can understand this. The point is that if you type "Initial", that's not object, …

Member Avatar for Hatem Faheem
0
109
Member Avatar for totalwar235

Have you called srand()? You need to seed the numbers first. You can look at this example: [URL="http://www.cplusplus.com/reference/clibrary/cstdlib/rand/"]cpp useful webpage[/URL] EDIT: ok, I see srand now :D... Try to break your code a bit... segment by segment, to pinpoint exactly where it goes wrong... For example, try to print rand(), …

Member Avatar for totalwar235
0
145
Member Avatar for Sci@phy

Hello. I've just started learning Python and I have a few questions. I'm using my program to communicate with some device through serial port using serial.py library. It's all going really fine. I've got a class device, and I'm using it to communicate with a device (logical ;) ). Q: …

Member Avatar for Sci@phy
0
112
Member Avatar for staufa

It should be like this (yeah, I like writing nonesence): [CODE=c] int i = 0; while ((string[i++] = getchar())!='\n'); string[i]='\0'; [/CODE]

Member Avatar for cthoes
0
326
Member Avatar for smnadig

You could write your hex-to-deci function, and then you can simply write [ICODE]char a = hex-to-deci-function(hex_num)[/ICODE]

Member Avatar for ArkM
0
1K
Member Avatar for sambafriends

[QUOTE=sambafriends;727086]thanx for replay can u explain briefly I used void so, there is no need to return any value[/QUOTE] You can drive your car without fastening seat belt, or walk through minefield :) But it's risky! So always use [ICODE]int main()[/ICODE] and return zero if succesful (in which case you …

Member Avatar for sambafriends
0
276
Member Avatar for asmNewbie

If you are running it under Windows XP CMD than it will only affect that window, because XP just simulates command prompt, doesn't load real one. So, answer to your question, if you are running XP, is NO

Member Avatar for jbennet
0
230
Member Avatar for Elmismo

Please post at least head of your header file... Until then, this: [URL="http://msdn.microsoft.com/en-us/library/f6xx1b1z(VS.71).aspx"]googleing![/URL] says this: [QUOTE]Linker Tools Error LNK2001 unresolved external symbol "symbol" Code references something (such as a function, variable, or label) that the linker can't find in the libraries and object files. Possible causes * What the code …

Member Avatar for ArkM
0
367
Member Avatar for d1s_0n3_guy
Member Avatar for JpegUser

Problem is you are going both ways! You are incrementing i iterator and at same time decrementing ptr_size2. Write something like: [CODE=C] ptr_size2 = ptr_size; temp = ptr; while (ptr_size2>=0) { temp[ptr_size-ptr_size2]=ptr[ptr_size2--]; }[/CODE]

Member Avatar for JpegUser
0
126
Member Avatar for n3XusSLO

AFAIK brackets can be used without any function or if statement, simply as code-block. They just come in handy for functions, classes, etc.

Member Avatar for Lerner
0
192
Member Avatar for britishemo15

why do you need kbhit? kbhit works more like a detector if key is pressed, it doesn't wait for keypress. Simply use getch?

Member Avatar for MosaicFuneral
0
1K
Member Avatar for clutchkiller
Member Avatar for Gannon56789

What does Earray point to? You've made it to null pointer: [ICODE]Earray[i] = 0 //like NULL[/ICODE] And your EmpPointer is unused... Seems like to me you're trying to allocate 2D array of some sort, but doing it wrong

Member Avatar for Agni
0
212
Member Avatar for The Dark Knight

hmm... write your own mul using logical operators and and or? I'm a beginner too, so don't really know how, but I'd try something with that Although it's not elegant solution

Member Avatar for carson myers
0
94
Member Avatar for hellIon

It works on my Dev-cpp (mingw, gcc) compiler, and I can't see any problem with code, so it's probably something about your compiler.

Member Avatar for Narue
0
134
Member Avatar for NinjaLink

Well, you obvioulsy need to increment counter each time you add a node, and decrement it each time you remove a node. It's really not hard, just put it in insert, delete, and create list. For checking if list is empty... simply check if first==NULL. But don't you need some …

Member Avatar for ArkM
0
3K
Member Avatar for Sci@phy

Hi! I have the following code: [CODE=asm] mov al, 5d neg al[/CODE] When it executes, CF = SF = AF = 1 Ok, I think I understand why AF (number is bigger than 00001111b ?), SF (most significant bit is now 1 not 0) But what I don't understand is …

0
119
Member Avatar for minas1

Make pointer to pointer [ICODE]**ptr[/ICODE], and allocate n pointers to it. Then to each of that n pointers [ICODE]*ptr[i][/ICODE] allocate n int's (or whatever). After that you can use it as regular 2D array: [ICODE]ptr[i][j][/ICODE]

Member Avatar for ArkM
0
123
Member Avatar for Sci@phy

Hello to all of you! I would really appreciate somebody telling me complete step by step tutorial how to work with MASM (or TASM, but I haven't noticed it's free to download) I've tried myself MASM and TASM (some Telemark assembly, not Borland), but for some reason it won't work, …

Member Avatar for NotNull
0
120
Member Avatar for hinduengg

And a little piece of advice. When working with decimal numbers, don't use float, instead use more precise double.

Member Avatar for hinduengg
0
142
Member Avatar for afg_91320

What you wrote will only chage 101'th element of array1 with 101'th element of array2. To copy arrays, you have to write function that will do that for each element

Member Avatar for skatamatic
0
2K
Member Avatar for vladdy191

Let's say you have arrays: [ICODE]int arr1[N], arr2[N];[/ICODE] Then [ICODE]arr1[/ICODE] and [ICODE]arr2[/ICODE] are actually pointers to first locations in arrays, so this would be true: [CODE=cplusplus] arr1== &arr1[0] && arr2==&arr2[0] [/CODE] Now you can see where I'm going at: [CODE=cplusplus] arr1 == arr2 //is like &arr1[0] == &arr2[0] [/CODE] So …

Member Avatar for skatamatic
0
92
Member Avatar for gunjanagrawal

[QUOTE=rati;712147]Hi gunjan, Can you please tell me what is the difference between [ICODE] void function(int*d); [/ICODE] and [ICODE] void function(int &d); [/ICODE] both above are function declarations and both we do the changes to the original variable passed to the function. Then what is the exact difference. Thanks in advance[/QUOTE] …

Member Avatar for nucleon
-1
186
Member Avatar for Asen

If I'm not mistaken, fillellipse draws standard (unrotated) ellipse, and there's nothing you can do to rotate it. You could try to draw your own ellipse, and then do something with that...

Member Avatar for Freaky_Chris
0
884
Member Avatar for k88joshi

Using '%' and '/' should be sufficent. First take a modulo 10 of number (and that is your last digit), then divide number by 10 (and you are left with number without last digit). And put that somehow in a for loop

Member Avatar for ArkM
0
88
Member Avatar for JustLearning

Also, when working with classes that allocate memory dynamically, you HAVE to write destructor that will free all allocated memory!

Member Avatar for Sci@phy
0
179
Member Avatar for m18

[ICODE]- radius = r;[/ICODE] Hmm... What's wrong with this code: [ICODE] -a = 300;[/ICODE]

Member Avatar for m18
0
147
Member Avatar for n8thatsme

Try to see if the problem is input or your class. Remove all user inputs from main and put something yourself in it. If it works, problem is only in input.

Member Avatar for seanhunt
0
164
Member Avatar for gangsta1903

Don't know if it helps. I myself am not sure if it's ok to write it, but compiler doesn't complain: [CODE=cplusplus] void func(int n){ int a[n]; for (int i = 1; i <= n; i++) a[i+1] = i*i; for (int i = 1; i <= n; i++) std::cout<<a[i+1]<<std::endl; return; }[/CODE]

Member Avatar for ddanbe
0
223
Member Avatar for something else

Err#1: this semicolon here: [ICODE]double getTheoreticalData(double x);[/ICODE] This is not necesarry:[ICODE]double PI;[/ICODE] Since you have included "cmath" header, you already have M_PI defined, and it's more precise than your PI! Err#2,3: y[] is not declared, z[] is not declared Err#4: after [ICODE]return 0;[/ICODE] you need closing bracket '}' for main()

Member Avatar for grumpier
0
126
Member Avatar for cam875

Ah, now you've said your problem. Solution is simple: AND && (notice, two & signs) OR || NOT !

Member Avatar for cam875
0
109
Member Avatar for sudokusolver
Member Avatar for thanatosys

Funny: [CODE=c] typedef struct node { char value; bool isroot; bool isend; struct node* sibling; struct node* child; }; //<== if semicolon goes here, it's much more reasonable [/CODE]

Member Avatar for thanatosys
0
264
Member Avatar for StephanJos

d is c++ string object, and printf is C function. Even more, not only it's C function (it would probably work nevertheless), but you've told it to print integer ( "%d" tells printf to print integer!)

Member Avatar for ivailosp
-1
133
Member Avatar for mrbiggbrain

And what exactly is the problem? You have no syntax errors, and I can't see anything wrong. But i'm sleepy, so maybe I'm wrong... Please be more specific

Member Avatar for Sci@phy
0
119
Member Avatar for Srynx
Member Avatar for nucleon
0
126
Member Avatar for cam875

You should check your microphone. It can sometimes be a problem (conflicts with compiler for c++)

Member Avatar for cam875
0
110
Member Avatar for thinfineline

You should use while loop, not for. And you haven't declared 'two' and 'zero'. Why don't you simply put 2 and 0?

Member Avatar for chococrack
0
115
Member Avatar for Jason123

You're getting char with [ICODE]cin.get(ch)[/ICODE] inside while function. You don't need [ICODE]cin>>ch;[/ICODE] before (it steals one char from you)

Member Avatar for Jason123
0
181

The End.