1,494 Posted Topics

Member Avatar for moye88

You don't have a variable to save the day that the max temp occurred on. Plus never and I mean never use a variable in a comparison without initializing it.. int Max; should be int Max = 0;/*Or whatever makes sense*/

Member Avatar for moye88
0
154
Member Avatar for ekailan

Are you trying to display the character's value as a hexadecimal? [code] #include <iostream> int main() { unsigned char myc = 'o'; std::cout << (int)myc << std::endl; std::cout << std::hex << (int)myc << std::endl; std::cout << std::oct << (int)myc << std::endl; return 0; } [/code]

Member Avatar for ekailan
0
441
Member Avatar for n0de

do you mean this array? [code] double * dSM = NULL [/code] It depends on the size you pass to new.

Member Avatar for n0de
0
7K
Member Avatar for ccube921
Member Avatar for gerard4143
0
72
Member Avatar for y9john
Member Avatar for jrw89

Because make software comes in many flavors and the script it executes 'can' depend on the operating system...It really depends.

Member Avatar for gerard4143
0
147
Member Avatar for mybluehair

Which operating system are use using...Threads are operating system specific. i.e. Threads coded on Linux will not work on Windows.

Member Avatar for DELmE
0
158
Member Avatar for gerard4143

Hi, I have a question about constructors and the difference between passing by value and by reference. If you look at the two examples I attached. Example one has a constructor that passes by value and example two pass by reference. Now I want to know why example one will …

Member Avatar for gerard4143
0
120
Member Avatar for vbx_wx

I'm not sure what trying to accomplish but you have String and string. If your using std::string in your class then you should include the header file and maybe call your version of string something more unique like maybe My_String.

Member Avatar for Ancient Dragon
0
94
Member Avatar for BlueZephyr
Member Avatar for widapol

You could write a program and test them yourself...Or you could check here for some examples: [url]http://cplus.about.com/od/learningc/ss/clessontwo_6.htm[/url]

Member Avatar for widapol
0
83
Member Avatar for ielo

Are you sure you didn't invalidate your iterators when you called erase...Try reinitializing you iterators after your call to erase and see if it displays properly.

Member Avatar for ielo
0
97
Member Avatar for centerline00

Try adding this line to your program while ((ch = cin.get()) != '\n'){} and read this link to find out what's going on [url]http://www.daniweb.com/forums/thread90228.html[/url] [code] #include <iostream> #include <string> using namespace std; int main() { string *name; // int *votes; int i; int numVotes; char ch; cout << "how many …

Member Avatar for gerard4143
0
132
Member Avatar for Nathaniel10

Use either [code] int* p1 = &p0[0]; [/code] or [code] int* p1 = p0; [/code]

Member Avatar for Nathaniel10
0
86
Member Avatar for devesh2222

Are you talking about binaries? If you are, what do mean view? Do you mean open a binary and view the hex or the original source code.

Member Avatar for Martin B
0
99
Member Avatar for mybluehair
Member Avatar for 9tontruck

Here's a pipe program that forks 5 times, with each child adding a row of the array longarray and then communicating the sum back to the parent... [code] #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <signal.h> #define ARR_ROW 5 #define ELEMENTS_PER_ROW 3 unsigned long longarray[ARR_ROW][ELEMENTS_PER_ROW] = { {1, 2, 3}, …

Member Avatar for gerard4143
0
187
Member Avatar for trebor09
Member Avatar for NotAround

For starters I would initialize these like so [code] panvowel.shortest[0] = '\0'; panvowel.longest[0] = '\0'; [/code]

Member Avatar for gerard4143
0
157
Member Avatar for gahhon

I'm not really sure what you mean by 'all of a'.... a[0] is equal to 0. a is the address of the first element or &a[0].

Member Avatar for halil.burak
0
92
Member Avatar for gaurav_13191

I'm only guessing here but should you be using some sort of trig functions to get your points...

Member Avatar for Adak
0
133
Member Avatar for R3Slick

Try this link: [url]http://www.networksorcery.com/enp/protocol/ip.htm[/url] Actually try downloading WireShark and checking out some headers.

Member Avatar for Pral
0
3K
Member Avatar for taquito86
Member Avatar for maremia

Posting your assignment will produce nothing...Please post the code that you tried and please indicate where your having problems..

Member Avatar for maremia
0
92
Member Avatar for eduard77

Your if statements are wrong. It should be if (condition) {statement;} While you have if (condition) if (condition) if (condition) Plus a = 0 is an assignment(a now equals 0)....You want a == 0 which is a comparison and yields true or false.

Member Avatar for eduard77
0
97
Member Avatar for oggiemc

What's (*q++)++ do? Well lets look inside the parenthesis at *q++. This is basically dereferencing the pointer *q and then incrementing the value *q++. (*q++)++ is incrementing the pointer q. The second for loop? It does the same thing but uses pointer arithmetic differently to achieve its goals. Please note …

Member Avatar for gerard4143
0
78
Member Avatar for chudapati09

I would loop through your string like below [code] #include <iostream> #include <string> int main() { std::string the_string; std::cout << "enter your number->"; std::cin >> the_string; std::cout << std::endl; for (unsigned int i = 0; i < the_string.size(); ++i) { //do your comparisons here // (the_string[i] == 'I') std::cout << …

Member Avatar for chudapati09
0
178
Member Avatar for glenak

Yes only have one main function. The main function is a placeholder for the start of execution, you can change the name if you inform the linker of the new name but generally you don't.

Member Avatar for gerard4143
0
143
Member Avatar for ricardo.crudo

The general rule is, for every time you malloc you have to call free.. Why set a pointer to NULL? Because if you call free on a NULL set pointer nothing happens, also its easy to check if a pointer is NULL by examining its value.. [code] int *ptr = …

Member Avatar for gerard4143
0
90
Member Avatar for Jsplinter
Member Avatar for Jsplinter
0
175
Member Avatar for rashid85
Member Avatar for hanvyj
Member Avatar for xinyonz

How hard is it to google [url]http://www.codingunit.com/c-tutorial-how-to-use-time-and-date-in-c[/url]

Member Avatar for Ancient Dragon
0
71
Member Avatar for Danny_501

Try here [url]http://www.hlnum.org/english/projects/tools/threadpool/doc.html[/url] It was hidden in the google query "posix thread pool"

Member Avatar for gerard4143
0
162
Member Avatar for coding101

Does stuff.txt exist in the same directory as the program? If not use a full path.

Member Avatar for coding101
0
64
Member Avatar for Alexkid
Member Avatar for XMasterrrr
Member Avatar for XMasterrrr
0
165
Member Avatar for XMasterrrr
Member Avatar for duanz_88

Yes please post what you have so far. We appreciate a little effort on your part.

Member Avatar for sree_ec
0
2K
Member Avatar for harpay

If roll is an int then you can set it to 'q' by simply doing this [code] roll = 'q'; [/code] but having one variable for two independent uses can lead to confusing code.

Member Avatar for emilo35
0
287
Member Avatar for sanjuanair

Could you put your question in context by giving us an example...

Member Avatar for Narue
0
125
Member Avatar for BLUEC0RE

Number one I would change your expression to: char expression; and then call a %c in your scanf. [code] #include <stdio.h> int main() { char expression; while ((scanf("%c",&expression)) != EOF) { fprintf(stdout, "char->%c\n", expression); } return 0; } [/code]

Member Avatar for gerard4143
0
3K
Member Avatar for widapol

Do you mean what is the last element? The last element is array[Index - 1]. Or do you mean how big can an array be? How many elements can it have.... C defines a type called size_t which accommodates the largest arrays.

Member Avatar for gerard4143
0
204
Member Avatar for Morbane

Here's a simple way to make the conversion using snprintf(). [code] #include <iostream> #include <cstdio> int main() { char ans[20]; float myf = 123.0 + (1.0 / 3.0); snprintf(ans, 20, "%f", myf); std::cout << "ans->" << ans << std::endl; return 0; } [/code]

Member Avatar for Morbane
0
2K
Member Avatar for burcin erek

Try changing your function to: [code] int burcin(int x) { if (x==1) return 1; else return (x+ burcin(x-1)); } [/code]

Member Avatar for burcin erek
0
106
Member Avatar for baby_c

Create your function like this [code] void increment( int *i ) { ++(*i); } [/code] and call it by passing the address of i [code] increment( &i ); [/code]

Member Avatar for baby_c
0
80
Member Avatar for Invecta

Try initializing these variables to zero... [code] int i, n, iNumber, iResult, iChoice; [/code]

Member Avatar for Invecta
0
238
Member Avatar for whimsical1987
Member Avatar for whimsical1987
0
2K
Member Avatar for bigwhiteegg
Member Avatar for alex55

It really depends, are you talking about a string object or are you talking about a c-string?

Member Avatar for alex55
0
148

The End.