519 Posted Topics

Member Avatar for neverine
Member Avatar for penguino138

Check out [URL="http://www.cplusplus.com/doc/tutorial/files/"]this[/URL] page

Member Avatar for penguino138
0
279
Member Avatar for darkdai

Conceptually sorting an array of strings is no different from sorting an array of integers. There is one main difference. When we are comparing 2 integers, say a and b, it is quite easy to say a is greater than / lesser than / equal to b. If you are …

Member Avatar for abhimanipal
0
92
Member Avatar for madmhan84
Member Avatar for Ancient Dragon
0
124
Member Avatar for wonkerloop

Also if you declare an array like [CODE]int arr[10] [/CODE] The last legal index into the array is 9. Anything beyond this and your code will crash.

Member Avatar for yashsaxena
0
166
Member Avatar for lochnessmonster

Read [URL="http://www.cprogramming.com/tutorial/function-pointers.html"]this[/URL]

Member Avatar for abhimanipal
0
58
Member Avatar for maybnxtseasn

Run this program. This should clear your confusion [CODE] #include<stdlib.h> typedef struct Person { char fname[100]; }FOO,*FOO1; int main() { FOO f1; FOO1 f2; printf("%d %d\n",sizeof(f1),sizeof(f2)); return 0; }[/CODE]

Member Avatar for abhimanipal
0
113
Member Avatar for bkoper16
Member Avatar for fifouta

Where is the code breaking ? Put some log statements to get a better idea of the behavior of your program

Member Avatar for abhimanipal
0
174
Member Avatar for drongo

[QUOTE=Arbus;1548986]In your code the declaration of the pointer account_array is fine. [CODE]char (account_array[size];[/CODE] [/QUOTE] I guess you meant [CODE]char *account_array[size];[/CODE]

Member Avatar for drongo
0
150
Member Avatar for joru819

Can you give the Input which is breaking the code ? Also put some log statements to print the number of points that the dealer and the player has

Member Avatar for abhimanipal
0
108
Member Avatar for cppgangster

In my experience Let us C is one of the best books for the C programming language. Try finishing the book completely. As for your question the functions you mentioned are provided in string.h ... Depending on the compiler that you are using you may or may not have it.

Member Avatar for abhimanipal
0
128
Member Avatar for quartaela

Check out [URL="http://www.difranco.net/cop2220/op-prec.htm"]this[/URL] link. It contains the operator precedence for all the operators in C If you look at this link carefully and then look at the sequence of operations in the statement *(list)-> head you will realize your mistake

Member Avatar for abhimanipal
0
444
Member Avatar for cestra

This is just a hunch but try including fstream.h instead of frstream Also can you make a sample code to just read data from a file as most of your errors seems related to file handling options

Member Avatar for cestra
0
206
Member Avatar for Abhishek Joshi

Can you please explain what you are trying to achieve in the if block lines 44 - 59

Member Avatar for L7Sqr
0
108
Member Avatar for asa88

Can you put some log statements so that we can see the flow of control when you try to fetch a page from Daniweb ... Paste the log output on the forum

Member Avatar for nezachem
0
725
Member Avatar for yongj
Member Avatar for Ancient Dragon
0
159
Member Avatar for CoilFyzx

To print a file you would need to interact with device drivers of the printer ... I dont know if that is easily achievable by using standard c programing

Member Avatar for Ancient Dragon
0
613
Member Avatar for lowhzplayinfool

I have some observations about the pop function.... May or may not apply to you Say you have 1,2,3,4,5 in the stack with the 5 being at the top. If I wanted to do a pop operation I would: 1. Copy the variable 5 in a temp variable. (Check for …

Member Avatar for lowhzplayinfool
0
134
Member Avatar for msrox

Try using the exact code written by AD [CODE]Form1::Form1^ form1 =gcnew Form1::Form1; form1->textBox1->Text="Hello!";[/CODE]

Member Avatar for Ancient Dragon
0
427
Member Avatar for abhimanipal

Hello Everybody, I was recently looking some code ... The person who wrote the code was using the ping command to send some data to the google.com and then he recovered some statistics from mdev ... [URL="http://www.daniweb.com/software-development/cpp/threads/360576/1542507#post1542507"]This[/URL] link contains the source code I am referring to ... My question is …

Member Avatar for Momerath
0
150
Member Avatar for bigdan182

Check out [URL="http://www.gamedev.net/page/resources/_/reference/programming/sweet-snippets/simple-file-io-using-c-r1127"]this[/URL] link

Member Avatar for abhimanipal
0
251
Member Avatar for montjoile

What is the purpose of this line ? [CODE]&*a= &(*fot);[/CODE] The code fragment that you have posted does not contain any loops or recursion . Please put some cout statements to get a better idea of the region where the code is freezing

Member Avatar for montjoile
0
292
Member Avatar for charchar88

Quick question do you know the relevance of the keyword extern ? I removed extern and the program compiled with just 1 warning

Member Avatar for TrustyTony
0
374
Member Avatar for cableguy31

Don't use the ping command. Create a socket to a remote server. Write some data to the socket.Check how much time it takes for the server to respond. The time difference can be your seed

Member Avatar for cableguy31
0
324
Member Avatar for abhimanipal

Hello Everybody, I am on a Ubuntu system and I just came across /dev/random I tried searching for examples of how to use this utility (or file/ or command) to generate a random number but I cannot find anything. Quick note I am trying to generate a random number on …

Member Avatar for Narue
0
125
Member Avatar for rannamaa

Also how about clearing the content in the namelist array before using the add function [CODE] for(int i=0;i<size;i++) { for(int j=0;j<namelist[i].length;j++) namelist[i][j] = '\0'; }[/CODE] Maybe overkill but wont hurt

Member Avatar for rannamaa
0
117
Member Avatar for MaAr91

Is your binary to decimal conversion correct ? For decimal to hexa decimal use the approach mentioned [URL="http://www.wikihow.com/Convert-from-Decimal-to-Hexadecimal"]here[/URL]

Member Avatar for WaltP
0
311
Member Avatar for jeff4L

An uninitialized global variable takes the value 0. Doing a 0/0 division will give you an Arithmetic exception. I think this should solve the crashing issue. How did you compile the program ? I also got the same compilation errors that mitrmkar got

Member Avatar for abhimanipal
0
246
Member Avatar for yongj

Check out [URL="http://www.cplusplus.com/reference/clibrary/cstdlib/system/"]this[/URL] link Also will your program be required to run on a non windows machine ?

Member Avatar for Ancient Dragon
0
164
Member Avatar for adot76
Member Avatar for abhimanipal
0
984
Member Avatar for ak24

One way is to check the ASCII value of each character. The space character, / character all have distinct values

Member Avatar for ak24
0
1K
Member Avatar for sc8515

Vector is a C collection class . Do you really require the names of your functions to be vector and free_vector ?

Member Avatar for Ancient Dragon
0
426
Member Avatar for trume
Member Avatar for Nandomo

Check out [URL="http://www.cplusplus.com/doc/tutorial/files/"]this[/URL] link

Member Avatar for Nandomo
0
117
Member Avatar for n3red

What is the issue with your program ? What is the expected output and what are you getting ?

Member Avatar for abhimanipal
0
160
Member Avatar for mitmehta22

I dont know if this is of any consequence or not but why do you have %*c in your fscanf ?

Member Avatar for abhimanipal
0
7K
Member Avatar for mariusiacob
Member Avatar for abhimanipal
0
3K
Member Avatar for write2diba

I think Dev C++ is usually for C++ not C thought I am not sure Please correct me if I am wrong

Member Avatar for rubberman
0
2K
Member Avatar for chester1908

Hi Chester I have a vague idea of what your question is , but before I dispense any advise can you please clarify your question ? PS: Some random thoughts which may or may not help you 1. If you have an array of structs, there is no way to …

Member Avatar for Ancient Dragon
0
195
Member Avatar for TinhornAdeniyi

Can you put the print for loop just after you read the content from the file. Post the output here

Member Avatar for WaltP
0
105
Member Avatar for jmcginny5

Dont get intimidated by the size of the problem statement ... Lets start with the first part of the problem statement ... What is the very first problem that you are facing and how do you think it should be solved ?

Member Avatar for damm
0
400
Member Avatar for TinhornAdeniyi

When you say double *max, the variable max contains the address. To print the value you have to write *max . PS I hope you have malloced memory for max [CODE] int main(); { int x =10; int *p = &x; printf("%d\n",*p); // This gives 10 printf("%u\n",p); // This gives …

Member Avatar for TinhornAdeniyi
0
104
Member Avatar for salty11

1. Write a loop to go through the entire file and populate the arrays. 2. After the loop in step 1 finishes then write the sorting function. What you have done now is that you have combined step 1 and step 2

Member Avatar for salty11
0
429
Member Avatar for nadleeh

Read the input file into a char array. Search through the char array for 2 consecutive \n\n ...

Member Avatar for abhimanipal
0
77
Member Avatar for aamira_s

Please [URL="http://en.wikipedia.org/wiki/Indent_style"]indent[/URL] your code properly .

Member Avatar for abhimanipal
0
166
Member Avatar for jimJohnson

Can you print the value of argv[1] ? Also can you get rid of line 27 completely ?

Member Avatar for abhimanipal
0
173
Member Avatar for MarginOfBuffett
Member Avatar for Narue
0
260
Member Avatar for kao
Member Avatar for jimJohnson

What issues are you getting ? "I am getting some issues" is not really helpful

Member Avatar for mike_2000_17
0
150

The End.