Solving Pointer in C Language: Placing ptr on name1,2,3

  • Thread starter Thread starter pouchito
  • Start date Start date
  • Tags Tags
    Language Pointers
Click For Summary

Discussion Overview

The discussion revolves around a programming problem in C language involving pointers and string comparison. The participant seeks assistance in placing pointers on three names based on a specified format using the less-than operator.

Discussion Character

  • Technical explanation, Homework-related, Debate/contested

Main Points Raised

  • The initial poster describes their approach using `strcmp` to place pointers on names based on a comparison involving the less-than operator.
  • One participant asserts that a name as an array of characters is inherently a pointer, suggesting that understanding this concept is crucial for resolving the issue.
  • Another participant expresses confusion regarding the clarity of the problem specification, emphasizing the importance of clear and unambiguous problem statements in programming.
  • The initial poster later claims that their problem is solved without detailing how the issue was resolved.

Areas of Agreement / Disagreement

The discussion includes varying levels of understanding and clarity regarding the problem specification, with some participants seeking more information while the initial poster claims to have resolved their issue.

Contextual Notes

The initial poster's solution process and the specific details of their code are not provided, leaving some assumptions about their approach unresolved.

pouchito
Messages
20
Reaction score
0
pointers ...C language

I need your help:

name1 < name 2 > name 3

I m writing a problem that place:
a pointer on name 1
a pointer on name 2
a pointer on name 3

I have been working on it more than 24 hours but in vain :cry:

what i did is strcmp with < if it is place ptr 1 (it works)
then
strcmp if there is sthg after the < place ptr 2 (it works)

BUT The same procedure didn't work for the latest name PLEASE I SPEND hundreds of hour on writing my program and i m still stuck in many parts...can u help me solving this part

thanks
 
Technology news on Phys.org
A name, assuming that you made it an array of characters, will always be a pointer. Make sure you understand that completely. It would help immensely if you posted your code so I can see exactly what you're doing incorrectly.
 
not clear

I don't understand your problem specification. The number one rule of computer science is that the problem specification must be spelled out clearly and non-ambiguous. You will find out this true for small assignments, and real projects.
 
my problem is solved !

Thanks all of you
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
Replies
7
Views
5K
  • · Replies 2 ·
Replies
2
Views
11K
  • · Replies 18 ·
Replies
18
Views
4K
  • · Replies 75 ·
3
Replies
75
Views
7K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 20 ·
Replies
20
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
5K