190 Posted Topics

Member Avatar for Shanebear
Member Avatar for Evan M
0
115
Member Avatar for Smed

As far as I see [URL="http://msdn.microsoft.com/en-us/library/ms633499.aspx"]here[/URL] it should be: [ICODE]notepad = FindWindow(NULL, "Notepad");[/ICODE]

Member Avatar for William Hemsworth
0
204
Member Avatar for Se7Olutionyg

[ICODE]float monitorhire ( float hireleft,float hireout) ;[/ICODE] This is wrong declaration inside main()! Advice: don't use so much global variables (none would be best)

Member Avatar for VernonDozier
0
136
Member Avatar for kawafis44

Have a look: [URL="http://www.cplusplus.com/reference/stl/set/"]set[/URL]

Member Avatar for Sci@phy
0
124
Member Avatar for jkiblin88

Guessing game? Well, ok... what kind of guessing game? And if you really have code, post it, please. And use code tags! [code][/code]

Member Avatar for Sci@phy
0
36
Member Avatar for piggysmile
Member Avatar for ArkM
0
91
Member Avatar for guest7
Member Avatar for msundastud

[QUOTE=msundastud;716933]can't figure out what I'm doing wrong....[/QUOTE] A lot of things! First, recheck your syntax, there are many errors. And you cannot declare [B]void[/B] function and then expect to get some result from it!

Member Avatar for devnar
0
165
Member Avatar for Superstar288

Although, if you're doing it for class of some sort, wouldn't it be better to make your own toupper? Just a thought. Remember, letters are stored actually as ascii code, and you can "add" them or even compare them ('a' > 'A' i think, maybe opposite)

Member Avatar for Narue
0
92
Member Avatar for Headerandy

Reason is that sstr is set to false AFTER trying to read after EOF. So first you read last item, it's ok, when while sees no error, continues, but you can't read more, so x is assigned to last good reading (last number) AND then sstr is set to FALSE! …

Member Avatar for Headerandy
0
154
Member Avatar for MyRedz

I (and presumably lots of people) don't understand your question at all. Maybe providing us with some example of what you want to do or something

Member Avatar for MyRedz
0
141
Member Avatar for Se7Olutionyg

I tried to count lines to see which one is line 39, and I managed it case 'I' : case 'i ' : Notice that second 'i ', do you see a difference between: 'i' 'i ' First is valid, second is invalid! Change that first

Member Avatar for VernonDozier
0
215
Member Avatar for Se7Olutionyg

For hundreth time: you don't call void function like: [ICODE]void myfunc()[/ICODE] but by simply typing: [ICODE]myfunc()[/ICODE] And what do you want with divide_by_zero()?

Member Avatar for Denniz
0
278
Member Avatar for begyu

You don't even need that, since you have a number before your matrix that tells you how big it is. Simply add second number after that, do some sort of while/for/do-while/goto loop (ok, maybe only while or for :) ) and it should work. If you want more help, post …

Member Avatar for Lerner
0
276
Member Avatar for concavang
Member Avatar for Salem
0
264
Member Avatar for Ninad16

[LIST=1][*] First you write code in some text editor. It doesn't matter what editor, it could even be notepad. Then you have to compile that code. Compilation refers to the processing of source code files (.c, .cc, or .cpp) and the creation of an 'object' file. This step doesn't create …

Member Avatar for Narue
0
394
Member Avatar for Balinor

I'm sorry, but your code is quite big. Try posting one question at a time, event if it means opening several threads at once.

Member Avatar for Balinor
0
119
Member Avatar for buddha527

[ICODE]while( chioce != 'n' );}[/ICODE] should actually be: [ICODE]} while( chioce != 'n' );[/ICODE] Have a nice coding :)

Member Avatar for buddha527
0
262
Member Avatar for DemonGal711

int a[m][m] int *ptr = a; int **ptr = ptr[m]; This doesn't make any sense. If you have to assign dynamic memory, you cannot type [ICODE]int a[m][m];[/ICODE]. Yes, you have to use pointers. Don't worry, they're not too scary. And using 2D array of pointers is a little itchy. First, …

Member Avatar for DemonGal711
0
122
Member Avatar for En-Motion

[QUOTE=cutedipti;714529]H! //everything good till this: For that you just use fflush(stdin) after each input line. so that it will clear(flushes) the previous 'new line' character and take the input correctly. Try out it!![/QUOTE] In C standard fflush accepts only output buffers, not input. Although most compilers do clear std buffer …

Member Avatar for WaltP
0
148
Member Avatar for MyRedz

I think that for binary search you need sorted list... so if you have unsorted array, linear search will have to do. Otherwise, binary is faster

Member Avatar for Sci@phy
0
134
Member Avatar for u3mo

your problem is cin>>char_var; Why? When you enter something on your keyboard and then press enter you have entered more characters. eg: YOU ENTER: p CHARS IN BUFFER: p, '\n' That '\n' is from the enter you pressed, and you have to get rid of it before next input. So, …

Member Avatar for chococrack
0
114
Member Avatar for Somersett

Well, if you're not going to acces members randomly but from begining to the end, maybe list would be perfect? On the other hand, you could use realloc for every n members (you choose n, but I wouldn't go over 100 if user input is small)

Member Avatar for Somersett
0
102
Member Avatar for scotchfx

I believe (but since I'm not familiar with IP thingies, I'm not sure) that you are assigning a bool here: [ICODE]in_addr_t ipaddr = inet_addr( s ) == -1[/ICODE] Is the same as [ICODE]in_addr_t ipaddr = (inet_addr( s ) == -1)[/ICODE] So you should write: [ICODE](in_addr_t ipaddr = inet_addr( s )) …

Member Avatar for ArkM
0
84
Member Avatar for peachslasher

[QUOTE]//i am not sure how to implement an array of linked list without vector[/QUOTE] And that's why I always say: start with C first. If you're making linked list, you don't use []. Inside your main() you just hold head pointer which points at first node. Your create_node code has …

Member Avatar for peachslasher
0
141
Member Avatar for teddybouch
Member Avatar for Salem
0
103
Member Avatar for tatainti55
Member Avatar for tatainti55
0
175
Member Avatar for teddybouch
Member Avatar for akshay144

int has it's largest number, and you can't insert a larger number in it than that. But I don't think that's even point. Your code asks you to input each digit in NEW LINE. Inputing them on same line will produce digit larger that nine, and thus output: "Invalid Input. …

Member Avatar for Sci@phy
0
133
Member Avatar for jammy's

Using stack without dynamic mem allocation is like... ummm... using stack without dynamic mem allocation (LOL)

Member Avatar for Denniz
0
330
Member Avatar for mypopope

I would recommend g++ (linux, or win) because it's real compiler, and not IDE. Since you are beginner, it's better to start with plain old compiler :)

Member Avatar for ArkM
0
142
Member Avatar for rkumaram

I believe you don't understand exactly process of "overloading" operators. You can really type whatever you want to do. It's just like a function. If you wish, it can print stuff on the screen. So the question is: what do you want it to do? Yet better, how do you …

Member Avatar for ArkM
0
151
Member Avatar for dusse

Use strcpy(string_to_be_copied, string_with_values_to_be_copied) to copy one string to another.

Member Avatar for Aia
0
347
Member Avatar for Freaky_Chris

[QUOTE=Freaky_Chris;714187]*cough* Dev-Cpp[/QUOTE] THIS compiled ok on dev-cpp: [CODE=cplusplus] int main() { DWORD dwThreadId; HANDLE myThread; void *ptr=NULL; myThread = CreateThread( NULL, 0, MyThreadFunction, ptr, 0, &dwThreadId); while(1){ Sleep(3); std::cout << "main"; } std::cin.get(); return 0; }[/CODE] notice the [ICODE]void* ptr;[/ICODE] I suspect problem is in your "HELLO", not in dwThreadId …

Member Avatar for Freaky_Chris
0
276
Member Avatar for unbeatable0

[QUOTE=unbeatable0;713170]What's IDE? I'm using Dev-C++ (version 4.9.9.2 if it helps...)[/QUOTE] That's IDE. :) IDE stands for integrated development environment. Best to describe it as a compiler and a lot of useful stuff that comes with it, almost always including specific text editor.

Member Avatar for dmanw100
0
130
Member Avatar for uae_uae99
Member Avatar for mauro21pl

[QUOTE=sidatra79;711947]Hi the code u posted is C code and not C++. So u would get better help and more replies if u would post it in the right section.[/QUOTE] Why do you think it is C++? :|

Member Avatar for WaltP
0
122
Member Avatar for Clockowl

It says [QUOTE]If the space cannot be allocated, the object remains unchanged.[/QUOTE] If that was your question? Furthermore, read this, I think it should help you: [URL="http://www.cplusplus.com/reference/clibrary/cstdlib/realloc.html"]realloc() info[/URL] Bottom point is, you can easily determine if memory has been copied to another place: [CODE=c] //ptr is already allocated with malloc …

Member Avatar for Salem
0
306
Member Avatar for cloudii
Member Avatar for cutedipti

@Narue I see you are using [ICODE]goto[/ICODE]. And I know programmers don't like to use goto, so if I may ask: why? :) Did you just use it because it's fastest to write code like that? Or would you still use it because it has more positive than negative sideeffects …

Member Avatar for Narue
0
128
Member Avatar for rrreeefff

[QUOTE=rrreeefff;710582]Here's what I came up with: [code=cplus] //a lot of code [/code] Here are the 2 errors- error C2296: '+' : illegal, left operand has type 'int (__cdecl *)(int)' and cpp(27) : error C2082: redefinition of formal parameter 'i'[/QUOTE] On line 22 you are declaring function. There's no semicolon in …

Member Avatar for Amisha_Sharma
0
135
Member Avatar for piggysmile

If you want to determine n-th digit (from the back, so second digit in 1234 is 3) in a number, you do this: a = number%(10^n) (now your digit is in first place) digit = a/(10^(n-1)) (now everything is stripped except your digit) That's the algorithm

Member Avatar for Denniz
0
394
Member Avatar for Aric69

If you'd be so kind to narrow down your problem to a small piece of readable code, please :)

Member Avatar for Lerner
0
160
Member Avatar for tatainti55

You have to pass variables as an argument. If you want to pass one argument of type char to a function that returns bool you declare function: [ICODE]bool Foo(char a_char)[/ICODE] And you call that function like (let's say you already have char letter inside main): [ICODE]Foo(letter);[/ICODE] BUT, if you want …

Member Avatar for tatainti55
0
105
Member Avatar for kavithabhaskar

for(j=10;j>=0;j--) { cout<<kavi[i]; } Do you expect your array to be size 10 always? This works, try to see why: [CODE=cplusplus] char kavi[]={"my shiny sword"}; cout<<kavi<<endl; cout<<"now reversing the word"<<endl; int i=-1; while(kavi[++i] != '\0'); i--; cout<<"Length is "<<i<<endl; for(int j=i; j>=0;j--) cout<<kavi[j]; [/CODE]

Member Avatar for skatamatic
0
6K
Member Avatar for afg_91320

So you want to print '*' n times, where n is a number of hundreds of dollars? $300 - n = 3 $630 - n = 6 $690 - n = 6? (or n = 7?) If so, divide each sale by n and store it in int (in that …

Member Avatar for afg_91320
0
284
Member Avatar for HaibrarAi_sY
Member Avatar for HaibrarAi_sY
0
93
Member Avatar for robgeek

[CODE]case 'C': case 'c': void Convert(maxTemp, minTemp, unit);[/CODE] What is this? You call void function like all others: [CODE]case 'C': case 'c': Convert(maxTemp, minTemp, unit); [/CODE]

Member Avatar for Sci@phy
0
196
Member Avatar for chunalt787

Are you sure this code works: [CODE]ll = queue.ll;[/CODE] 'll' is under private section, right? I'm not sure if you can access it. Here's my code example if it helps: [CODE=cplusplus] //operators //= Complex& Complex::operator=(Complex const& aCplx){ if (this != &aCplx){ mNum.Im = aCplx.getIm(); mNum.Re = aCplx.getRe(); } return *this; …

Member Avatar for chunalt787
0
267
Member Avatar for blinkliveson

And what is the question? Um, ok... I'll give you a hint... something about your for loop is wrong. It will always return that number is prime. Try to backtrack you program if you enter for example number 4. It shouldn't be prime, but... :) And for all those if-statements... …

Member Avatar for Sci@phy
0
180

The End.