2,384 Posted Topics

Member Avatar for smartintelleng

You could edit your image tags to look like this: [[COLOR=Black]IMG[/COLOR]]http://www.computersforpennies.com/error.gif[[COLOR=Black]/IMG[/COLOR]] Then you will see this: [IMG]http://www.computersforpennies.com/error.gif[/IMG]

Member Avatar for nvanevski
0
119
Member Avatar for AllenN

Look [url=http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1043803465&id=1043284385]here[/url] and [url=http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1042856625&id=1043284385]here[/url].

Member Avatar for vegaseat
0
183
Member Avatar for CNewbie

[url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1043372399&id=1043284385#opt3[/url]

Member Avatar for vegaseat
0
165
Member Avatar for wangstarr

A word is a sequence of non-whitespace characters separated by whitespace. Use a flag to indicate when you are in whitespace or not. Going from non-whitespace to whitespace would be the end of a word.

Member Avatar for varunrathi
0
314
Member Avatar for lilpil02

Post the code you've got between CODE tags. [Quid pro quo](http://www.daniweb.com/techtalkforums/announcement.php?f=8&announcementid=2).

Member Avatar for lilpil02
0
173
Member Avatar for hkb

[code] sort(totalScore[COLOR=Red][][/COLOR], 100, student[COLOR=Red][][/COLOR]);[/code]Remove the empty brackets. [code]display(student, totalScore[COLOR=Red][i][/COLOR]);[/code]The prototype calls for an array, you are passing a single element. [code] int i; cout << student[i].name << endl;[/code]Uh, shouldn't i be given a value? [code]void swap(double totalScore[], int i, int j) void swap2(Student student[], int i, int j) swap (totalScore[i], …

Member Avatar for Dave Sinkula
0
113
Member Avatar for gowswan

>#include<iostream.h> >#include<conio.h> Nonstandard headers. >#include<stdio.h> Unused header. >void main() Incorrect. >clrscr(); Unnecessary and a nonstandard function. > n[c] = 55 + r; > n[c] = 48 + r; ASCII hacks. >getch(); Nonstandard function.

Member Avatar for Dave Sinkula
0
121
Member Avatar for hopeolicious

I'd need the complete code to get it to compile. And if you want anyone to take a really good look at code, use [CODE] tags. But why do you have a strangely worded loop here? while ( st_line[x] != '\0' )

Member Avatar for jwenting
0
122
Member Avatar for jaeSun
Member Avatar for jwenting
0
163
Member Avatar for Faramba

>what is the vvalue of strcmp(s2, s3)<0 1 >"Please explain" You try. We'll help.

Member Avatar for Dave Sinkula
0
185
Member Avatar for craigt

[QUOTE=craigt]While a runtime init would work I need a build-time init. The project target is a small 8 bit processor and I don't need the extra overhead that a runtime init would add. The first init that I listed in the original post is probably as small an init as …

Member Avatar for craigt
0
320
Member Avatar for Extreme
Member Avatar for Extreme
0
97
Member Avatar for Faramba

The C-style string handling functions are declared in <[COLOR=Blue]c[/COLOR]string>, not <string>.

Member Avatar for Dave Sinkula
0
84
Member Avatar for Archer

[QUOTE=Archer][code] getch(); main(); } main() { int i[N],e; clrscr();[/code][/QUOTE]Yeeeeeeeeech!

Member Avatar for Dave Sinkula
0
163
Member Avatar for boujibabe

[QUOTE=boujibabe]You're right, any help on improving the one I did already simply?[/QUOTE] Don't use magic numbers like 5 and 65.

Member Avatar for boujibabe
-1
205
Member Avatar for Moo The Cow

[QUOTE=Moo The Cow]When I run the program, it doesn't print the "Hello, world!", but I just see a dos window quickly flash on my screen. What (and where) should I add to this code to prevent this?[/QUOTE][url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1043803465&id=1043284385[/url]

Member Avatar for harshchandra
0
155
Member Avatar for Der_sed

[code] for ( i=1 ; i<[color=red]=[/color]10 ; i++ ) cout<<arr[i]<<" "; [/code]You went beyond array bounds. You should do this:[code] for ( i=0 ; i<10 ; i++ ) cout<<arr[i]<<" "; [/code]

Member Avatar for Der_sed
0
221
Member Avatar for Asif_NSU

[QUOTE=Asif_NSU][COLOR=Blue]I want to take integer inputs separated by spaces and terminated by newline character.[/COLOR] suppose the user will be inserting integers this way 123 566 789 45 34 8999 341 57 67 and then the user presses enter. so the program will read all the integers when the user presses …

Member Avatar for Asif_NSU
0
163
Member Avatar for walljoshua

[code]#include <stdio.h> int main ( void ) { int array[] = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 }; size_t i; for (i = 0; i < sizeof array / sizeof *array; ++i ) { printf("%10d[COLOR=Blue]%c[/COLOR]", array[i], [COLOR=Blue]i % 5 == 4 ? '\n' : ' '[/COLOR]); } return 0; } /* my output …

Member Avatar for big146
0
108
Member Avatar for jifiii

[FONT=Courier New]argv[1][/FONT] and [FONT=Courier New]argv[3][/FONT], if available, are strings. Convert them to integers before attempting to add them; [FONT=Courier New]atoi[/FONT] may be useful for this. [FONT=Courier New]argv[2][/FONT] is a string also. Use [FONT=Courier New]argv[2][0][/FONT] for the first character. [edit]D'oh! Didn't even look at [FONT=Courier New]main[/FONT], which should be declared like …

Member Avatar for Dave Sinkula
0
126
Member Avatar for AussieBob

[code]#include <stdio.h> int main ( void ) { char caption [ 3 ]; int letter, number; for ( letter = 0; letter < 5; letter++ ) { for ( number = 0; number < 5; number++ ) { [COLOR=Blue]sprintf ( caption, "%c%d", letter + 'A', number + 1 );[/COLOR] printf …

Member Avatar for Dave Sinkula
0
93
Member Avatar for JoBe

Describe, in English sentences, what you think the data types are for the following:[list][*][FONT=Courier New]naam[/FONT] [*][FONT=Courier New]temp[/FONT][/list]

Member Avatar for Dave Sinkula
0
430
Member Avatar for dcving

Check return values. Always use { and } to enclose code blocks. Indent properly. [url]http://www.parashift.com/c++-faq-lite/input-output.html#faq-15.5[/url]

Member Avatar for jwenting
0
112
Member Avatar for mattcplusplus

>can someone tell me what static does to the function? [url]http://www.embedded.com/98/9811/9811fe3.htm[/url] about halfway down, although the whole article is worthwhile.

Member Avatar for Narue
0
191
Member Avatar for missy
Member Avatar for Dave Sinkula
0
99
Member Avatar for Stack Overflow

[QUOTE=Stack Overflow]Another Example:[code][color=blue]#include[/color] <stdio.h> [color=blue]int[/color] main() { [color=blue]char[/color] ch[25]; [color=blue]char[/color] *p; p = &ch[0]; scanf(“%s

Member Avatar for Dave Sinkula
0
258
Member Avatar for mdos

How about this? [code]#include <stdio.h> [COLOR=Blue]char dummy [ sizeof(int) == 4 ];[/COLOR] int main(void) { return 0; }[/code]

Member Avatar for Narue
0
367
Member Avatar for galmca

[code] #include <stdio.h> int main(){int*i,*j,a[]={10,20,30,40,30};for(i=a;i<&a[sizeof a/sizeof*a];++i){for(j=a;j<i;++j){if(*i==*j){break;}}if(i==j){printf(&",%d"[i==a],*i);}}putchar('\n');return 0;} [/code]

Member Avatar for alc6379
0
352
Member Avatar for mahas

[url="http://www.catb.org/%7Eesr/faqs/smart-questions.html#writewell"]http://www.catb.org/~esr/faqs/smart-questions.html#writewell[/url]

Member Avatar for Narue
0
213
Member Avatar for hfick
Member Avatar for Narue
0
164
Member Avatar for m-soft
Member Avatar for vegaseat
0
140
Member Avatar for NitrousGT

[QUOTE=sjopkg]I also need help getting started on this same program. But I don't even know where to start... any help would be great![/QUOTE][code]// your code here int main() { // your code here return 0; }[/code]

Member Avatar for alc6379
0
353
Member Avatar for Asif_NSU

[url="http://www.dinkumware.com/manuals/reader.aspx?lib=cpp"]http://www.dinkumware.com/manuals/reader.aspx?lib=cpp[/url] [url="http://www.cppreference.com"]http://www.cppreference.com[/url] [url="http://groups.google.com/groups?hl=en&lr=&group=comp.lang.c%2B%2B"]http://groups.google.com/groups?hl=en&lr=&group=comp.lang.c%2B%2B[/url]

Member Avatar for vegaseat
0
251
Member Avatar for prathys

[QUOTE=prathys]I came across a strange thing when doing program in c++ in visualc++ environment.just run this code and after entering the array elements press up arrow and down arrow.[/QUOTE]Would you mind telling us what this "strange thing" was? Or might you be marvelling at the command shell in which your …

Member Avatar for Asif_NSU
0
137
Member Avatar for JoBe

The simple and not so great way of iterating through the array to see if it is a duplicate and discarding it may go something like this. [code] #include <stdlib.h> #include <stdio.h> #include <time.h> #define SIZE 100 #define MAX 1000 int main(void) { int array[SIZE]; size_t i,j; srand(time(NULL)); for ( …

Member Avatar for JoBe
0
185
Member Avatar for Nyika

[CODE] #include <iostream> #include "Erfn.h" int main() { Erfn var; for ( double i = 0; i < 4.25; i += 0.5 ) { std::cout << "Erfn(" << i << ") = " << var(i) << std::endl; } return 0; } /* my output Erfn(0) = 0 Erfn(0.5) = 0.5202 …

Member Avatar for Nyika
0
100
Member Avatar for sjopkg

[QUOTE=sjopkg]Any help on getting started would be awesome!!![/QUOTE][code]// your code here int main() { // your code here return 0; }[/code]

Member Avatar for Dave Sinkula
0
143
Member Avatar for Sukhbir

[url="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1047673478&id=1043284351"]Casting malloc[/url] [code]int *a = malloc(10 * sizeof *a);[/code]

Member Avatar for Narue
0
141
Member Avatar for tendekai

Maybe your issue is related to the missing [font=Courier New])[/font]. [code] if(strcmp(h.depart,"Sales")==0[/code] [EDIT]Oh, wait! Are you compiling C++ code in a C compiler?

Member Avatar for Narue
0
198
Member Avatar for cblue
Member Avatar for somer2412

>>Can someone please help me with a statement to calculate the median when the array is even. >Take the median of the two middle items: a[size / 2] and a[size / 2 + 1]. Wouldn't that be the [i]mean[/i] of [font=Courier New]a[size / 2][/font] and [font=Courier New]a[size / 2 [/font][font=Courier …

Member Avatar for Dave Sinkula
0
392
Member Avatar for hejones

Please read the [url="http://www.daniweb.com/techtalkforums/announcement.php?f=8&announcementid=2"][b]Announcement[/b][/url].

Member Avatar for Dave Sinkula
0
143
Member Avatar for wangstarr

Maybe you were planning to implement your ShowDate function and call it before exiting, but you didn't.

Member Avatar for Stack Overflow
0
361
Member Avatar for mohammad
Member Avatar for Dave Sinkula
0
83
Member Avatar for hill0ster

[URL]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044873249&id=1043284392[/URL]

Member Avatar for Dave Sinkula
0
259
Member Avatar for cblue

I generally use the % operator. [CODE]#include <stdio.h> int main(void) { int i = 1; while ( i <= 50 ) { printf("%3d ", i); [color=Blue]if ( i % 10 == 0 )[/color] { putchar('\n'); } ++i; } return 0; } [color=Sienna]/* my output 1 2 3 4 5 6 …

Member Avatar for Dave Sinkula
0
103
Member Avatar for ellas747

>the problem is how do i put the results in a histogram form. Are you saying you would like output something like this? [CODE] $200-$299 : 1 * $300-$399 : 2 ** $400-$499 : 1 * $500-$599 : 4 **** $600-$699 : 6 ****** $700-$799 : 2 ** $800-$899 : …

Member Avatar for Dave Sinkula
0
125
Member Avatar for rmerchan

> Any help would be greatly appreciated. [CODE]#include <stdio.h> float get_lat1(void); int main (void) { float latitude = get_lat1(); printf("the value of latitude is %f \n", latitude); return 0; } float get_lat1(void) { int degrees, minutes; float seconds, latitude = 0; char direction; printf("Enter the Prepare to enter data for …

Member Avatar for Dave Sinkula
0
195
Member Avatar for hill0ster

[CODE]#include <iostream> #include <cstdlib> using namespace std; // for toy programs bool getEmployeeData(int [color=Blue]&[/color]ID) { cout << "Enter employee ID: "; cin >> ID; if ( ID >= 0 ) { return true; } return false; } int main() { int id; if ( getEmployeeData(id) == false ) { cout …

Member Avatar for hill0ster
0
73
Member Avatar for kind4ever

It looks like you forgot to read the http://www.daniweb.com/techtalkforums/announcement.php?f=8&announcementid=2 announcement. Post the code you have, but wrapped in code tags.

Member Avatar for kind4ever
0
159

The End.